{
  "Type": "Window",
  "Id": "ground_forces",
  "Title": "Ground Forces",
  "Icon": "\u2694",
  "Classes": [
    "ps-window-holo"
  ],
  "State": "Maximized",
  "DisplayLocation": "Taskbar",
  "WindowGroup": "static_menu",
  "IsRestorable": false,
  "IsMinimizable": false,
  "Width": "100%",
  "Height": "100%",
  "Background": "rgba(0,0,0,0.85)",
  "Padding": "16",
  "Children": [
    {
      "Type": "Grid",
      "Width": "100%",
      "Height": "100%",
      "ColumnDefinitions": [
        "1fr"
      ],
      "RowDefinitions": [
        "auto",
        "auto",
        "1fr"
      ],
      "Children": [
        {
          "Type": "StackPanel",
          "Grid.Row": 0,
          "Orientation": "Horizontal",
          "VerticalAlignment": "Center",
          "Gap": 16,
          "Margin": "0 0 12 0",
          "Children": [
            {
              "Type": "Select",
              "Id": "gf_race_select",
              "Width": "220px",
              "Value": "",
              "Options": [],
              "Command": "ground.forces.select_race"
            },
            {
              "Type": "Label",
              "Text": "Armour Strength:",
              "Classes": [
                "ps-text-secondary"
              ],
              "VerticalAlignment": "Center"
            },
            {
              "Type": "Label",
              "Id": "gf_racial_armour",
              "Text": "0",
              "Classes": [
                "ps-data"
              ],
              "VerticalAlignment": "Center"
            },
            {
              "Type": "Label",
              "Text": "Weapon Strength:",
              "Classes": [
                "ps-text-secondary"
              ],
              "VerticalAlignment": "Center"
            },
            {
              "Type": "Label",
              "Id": "gf_racial_weapon",
              "Text": "0",
              "Classes": [
                "ps-data"
              ],
              "VerticalAlignment": "Center"
            },
            {
              "Type": "Label",
              "Text": "Tracking Speed:",
              "Classes": [
                "ps-text-secondary"
              ],
              "VerticalAlignment": "Center"
            },
            {
              "Type": "Label",
              "Id": "gf_racial_tracking",
              "Text": "0 km/s",
              "Classes": [
                "ps-data"
              ],
              "VerticalAlignment": "Center"
            },
            {
              "Type": "Label",
              "Text": "FC Range:",
              "Classes": [
                "ps-text-secondary"
              ],
              "VerticalAlignment": "Center"
            },
            {
              "Type": "Label",
              "Id": "gf_racial_fc_range",
              "Text": "0 km",
              "Classes": [
                "ps-data"
              ],
              "VerticalAlignment": "Center"
            }
          ]
        },
        {
          "Type": "Label",
          "Id": "gf_status",
          "Grid.Row": 1,
          "Text": "",
          "IsVisible": false,
          "Classes": [
            "ps-text-secondary"
          ],
          "Margin": "0 0 12 0"
        },
        {
          "Type": "TabContainer",
          "Id": "gf_tabs",
          "Grid.Row": 2,
          "Width": "100%",
          "Height": "100%",
          "Command": "ground.forces.select_tab",
          "Children": [
            {
              "Type": "TabItem",
              "Title": "Order of Battle",
              "Children": [
                {
                  "Type": "Grid",
                  "Width": "100%",
                  "Height": "100%",
                  "ColumnDefinitions": [
                    "360px",
                    "1fr"
                  ],
                  "RowDefinitions": [
                    "auto",
                    "1fr",
                    "auto"
                  ],
                  "Children": [
                    {
                      "Type": "Grid",
                      "Grid.Row": 0,
                      "Grid.ColumnSpan": 2,
                      "ColumnDefinitions": [
                        "150px",
                        "150px",
                        "120px",
                        "150px",
                        "1fr"
                      ],
                      "RowDefinitions": [
                        "auto",
                        "auto"
                      ],
                      "Margin": "0 0 16px 0",
                      "Children": [
                        {
                          "Type": "Checkbox",
                          "Id": "gf_oob_group_location",
                          "Grid.Row": 0,
                          "Grid.Column": 0,
                          "Label": "Location",
                          "Command": "ground.forces.toggle_oob_filter"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_oob_show_field_position",
                          "Grid.Row": 0,
                          "Grid.Column": 1,
                          "Label": "Field Position",
                          "Command": "ground.forces.toggle_oob_filter"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_include_civilian",
                          "Grid.Row": 0,
                          "Grid.Column": 2,
                          "Label": "Civilian",
                          "Command": "ground.forces.toggle_oob_filter"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_oob_amount_popup",
                          "Grid.Row": 0,
                          "Grid.Column": 3,
                          "Label": "Amount Popup",
                          "Command": "ground.forces.toggle_oob_filter"
                        },
                        {
                          "Type": "StackPanel",
                          "Grid.Row": 0,
                          "Grid.Column": 4,
                          "Orientation": "Horizontal",
                          "Gap": 8,
                          "VerticalAlignment": "Center",
                          "Children": [
                            {
                              "Type": "Label",
                              "Id": "gf_oob_location_name",
                              "Flex": "1",
                              "Text": "",
                              "Classes": [
                                "ps-text-secondary"
                              ]
                            },
                            {
                              "Type": "Label",
                              "Text": "Replacement Template",
                              "Classes": [
                                "ps-text-secondary"
                              ]
                            },
                            {
                              "Type": "Label",
                              "Id": "gf_oob_repl_template",
                              "Width": "150px",
                              "Text": "None"
                            },
                            {
                              "Type": "Label",
                              "Text": "Priority",
                              "Classes": [
                                "ps-text-secondary"
                              ]
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_oob_priority",
                              "Width": "70px",
                              "InputType": "number",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_oob_field"
                            },
                            {
                              "Type": "Checkbox",
                              "Id": "gf_oob_use_replacements",
                              "Label": "Use For Replacements",
                              "Command": "ground.forces.toggle_oob_filter"
                            }
                          ]
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_oob_show_ships",
                          "Grid.Row": 1,
                          "Grid.Column": 0,
                          "Label": "Ships",
                          "Command": "ground.forces.toggle_oob_filter"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_oob_show_elements",
                          "Grid.Row": 1,
                          "Grid.Column": 1,
                          "Label": "Elements",
                          "Command": "ground.forces.toggle_oob_filter"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_include_support",
                          "Grid.Row": 1,
                          "Grid.Column": 2,
                          "Label": "Support",
                          "Command": "ground.forces.toggle_oob_filter"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_oob_sort_creation",
                          "Grid.Row": 1,
                          "Grid.Column": 3,
                          "Label": "Sort Creation",
                          "Command": "ground.forces.toggle_oob_filter"
                        },
                        {
                          "Type": "Label",
                          "Id": "gf_oob_commander",
                          "Grid.Row": 1,
                          "Grid.Column": 4,
                          "Flex": "1",
                          "Text": "No commander assigned",
                          "Classes": [
                            "ps-text-secondary"
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Row": 1,
                      "Grid.Column": 0,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Margin": "0 0 12 0",
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Formation Hierarchy",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "Tree",
                          "Id": "gf_oob_tree",
                          "Flex": "1",
                          "EnableVerticalScroll": true,
                          "FullRowToggle": false
                        }
                      ]
                    },
                    {
                      "Type": "Grid",
                      "Grid.Row": 1,
                      "Grid.Column": 1,
                      "RowDefinitions": [
                        "1fr",
                        "auto"
                      ],
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Grid.Row": 0,
                          "Orientation": "Vertical",
                          "Gap": 8,
                          "Children": [
                            {
                              "Type": "DataGrid",
                              "Id": "gf_formation_element_grid",
                              "Flex": "1",
                              "EnableVerticalScroll": true,
                              "SelectionMode": "Single",
                              "OnSelectionChanged": "ground.forces.select_oob_element",
                              "Columns": [
                                {
                                  "Header": "Abbr",
                                  "Field": "abbr",
                                  "Width": "60px",
                                  "sortField": "abbr"
                                },
                                {
                                  "Header": "Name",
                                  "Field": "name",
                                  "Flex": 1,
                                  "sortField": "name"
                                },
                                {
                                  "Header": "Units",
                                  "Field": "units",
                                  "Width": "60px",
                                  "sortField": "units"
                                },
                                {
                                  "Header": "Supply",
                                  "Field": "supply",
                                  "Width": "60px"
                                },
                                {
                                  "Header": "Morale",
                                  "Field": "morale",
                                  "Width": "60px",
                                  "sortField": "morale"
                                },
                                {
                                  "Header": "Fort",
                                  "Field": "fort",
                                  "Width": "55px"
                                },
                                {
                                  "Header": "Size",
                                  "Field": "size",
                                  "Width": "65px",
                                  "sortField": "size"
                                },
                                {
                                  "Header": "Cost",
                                  "Field": "cost",
                                  "Width": "65px",
                                  "sortField": "cost"
                                },
                                {
                                  "Header": "HP",
                                  "Field": "hp",
                                  "Width": "55px"
                                },
                                {
                                  "Header": "GSP",
                                  "Field": "gsp",
                                  "Width": "60px"
                                },
                                {
                                  "Header": "Attributes",
                                  "Field": "attributes",
                                  "Width": "130px"
                                },
                                {
                                  "Header": "AR",
                                  "Field": "ar",
                                  "Width": "55px"
                                },
                                {
                                  "Header": "RR",
                                  "Field": "rr",
                                  "Width": "55px"
                                }
                              ],
                              "Rows": []
                            }
                          ]
                        },
                        {
                          "Type": "StackPanel",
                          "Grid.Row": 1,
                          "Orientation": "Vertical",
                          "Gap": 4,
                          "Margin": "16px 0 0 0",
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Element Class",
                              "Style": "Label.Subheading"
                            },
                            {
                              "Type": "Panel",
                              "Id": "gf_oob_element_readout_glass",
                              "Width": "100%",
                              "MaxHeight": "220px",
                              "Classes": [
                                "ps-panel",
                                "ps-panel--glass"
                              ],
                              "Children": [
                                {
                                  "Type": "PropertyGrid",
                                  "Id": "gf_oob_element_readout",
                                  "MaxHeight": "220px",
                                  "EnableVerticalScroll": true,
                                  "Sections": []
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Row": 2,
                      "Grid.ColumnSpan": 2,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Margin": "8 0 0 0",
                      "Children": [
                        {
                          "Type": "Grid",
                          "ColumnDefinitions": [
                            "1fr",
                            "170px",
                            "170px",
                            "170px"
                          ],
                          "Children": [
                            {
                              "Type": "Input",
                              "Id": "gf_formation_name",
                              "Grid.Column": 0,
                              "Placeholder": "Formation Name",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_oob_field"
                            },
                            {
                              "Type": "Select",
                              "Id": "gf_field_position_select",
                              "Grid.Column": 1,
                              "Options": [],
                              "Command": "ground.forces.set_oob_field"
                            },
                            {
                              "Type": "Select",
                              "Id": "gf_parent_select",
                              "Grid.Column": 2,
                              "Options": [],
                              "Command": "ground.forces.set_oob_field"
                            },
                            {
                              "Type": "Select",
                              "Id": "gf_support_select",
                              "Grid.Column": 3,
                              "Options": [],
                              "Command": "ground.forces.set_oob_field"
                            }
                          ]
                        },
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 8,
                          "Children": [
                            {
                              "Type": "Button",
                              "Text": "Rename",
                              "Command": "ground.forces.rename_formation",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Field Position",
                              "Command": "ground.forces.apply_field_position",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Set Parent",
                              "Command": "ground.forces.apply_parent",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Clear Hierarchy",
                              "Command": "ground.forces.clear_parent",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Set Support",
                              "Command": "ground.forces.apply_support",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Clear Support",
                              "Command": "ground.forces.clear_support",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Do Not Recover",
                              "Command": "ground.forces.toggle_dnr",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Active On",
                              "Command": "ground.forces.toggle_active",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Delete",
                              "Command": "ground.forces.delete_formation",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Text": "Scrap",
                              "Command": "ground.forces.scrap_formation",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Label",
                              "Id": "gf_oob_summary",
                              "Text": "No formations match the current filters.",
                              "Margin": "12 0 0 0",
                              "Classes": [
                                "ps-text-secondary"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_rename_formation_modal",
                  "Title": "Rename Formation",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_rename_formation",
                  "Width": "460px",
                  "Height": "140px",
                  "BadgeText": "Rename",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Orientation": "Horizontal",
                      "Gap": 12,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Name",
                          "VerticalAlignment": "Center",
                          "Width": "90px"
                        },
                        {
                          "Type": "Input",
                          "Id": "gf_rename_formation_name",
                          "Placeholder": "Formation Name",
                          "CommitOnInput": true,
                          "Command": "ground.forces.set_rename_formation_name",
                          "Flex": "1"
                        }
                      ]
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Rename",
                      "Command": "ground.forces.confirm_rename_formation",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_rename_formation"
                    }
                  ]
                }
              ]
            },
            {
              "Type": "TabItem",
              "Title": "Formation Templates",
              "Children": [
                {
                  "Type": "Grid",
                  "Width": "100%",
                  "Height": "100%",
                  "ColumnDefinitions": [
                    "1fr",
                    "1fr"
                  ],
                  "RowDefinitions": [
                    "1fr",
                    "auto",
                    "auto"
                  ],
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 0,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Unit Types",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "DataGrid",
                          "Id": "gf_template_grid",
                          "EnableVerticalScroll": true,
                          "SelectionMode": "Single",
                          "OnSelectionChanged": "ground.forces.select_unit_type",
                          "Columns": [
                            {
                              "Header": "Type",
                              "Field": "type",
                              "Width": "90px"
                            },
                            {
                              "Header": "Name",
                              "Field": "name",
                              "Flex": 1
                            },
                            {
                              "Header": "Components",
                              "Field": "components",
                              "Flex": 1
                            },
                            {
                              "Header": "Size",
                              "Field": "size",
                              "Width": "60px"
                            },
                            {
                              "Header": "Cost",
                              "Field": "cost",
                              "Width": "60px"
                            },
                            {
                              "Header": "Arm",
                              "Field": "arm",
                              "Width": "60px"
                            },
                            {
                              "Header": "HP",
                              "Field": "hp",
                              "Width": "60px"
                            },
                            {
                              "Header": "GSP",
                              "Field": "gsp",
                              "Width": "60px"
                            }
                          ],
                          "Rows": [],
                          "FooterLeftText": ""
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 1,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Formation Templates",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "DataGrid",
                          "Id": "gf_template_element_grid",
                          "EnableVerticalScroll": true,
                          "SelectionMode": "Single",
                          "OnSelectionChanged": "ground.forces.select_template",
                          "Columns": [
                            {
                              "Header": "Abbr",
                              "Field": "abbr",
                              "Width": "60px"
                            },
                            {
                              "Header": "Name",
                              "Field": "name",
                              "Flex": 1
                            },
                            {
                              "Header": "Units",
                              "Field": "units",
                              "Width": "60px"
                            },
                            {
                              "Header": "Size",
                              "Field": "size",
                              "Width": "60px"
                            },
                            {
                              "Header": "Cost",
                              "Field": "cost",
                              "Width": "60px"
                            },
                            {
                              "Header": "HP",
                              "Field": "hp",
                              "Width": "60px"
                            },
                            {
                              "Header": "GSP",
                              "Field": "gsp",
                              "Width": "60px"
                            },
                            {
                              "Header": "Template Attributes",
                              "Field": "attributes",
                              "Width": "160px"
                            },
                            {
                              "Header": "Rank",
                              "Field": "rank",
                              "Width": "60px"
                            }
                          ],
                          "Rows": [],
                          "FooterLeftText": ""
                        },
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 8,
                          "Children": [
                            {
                              "Type": "Button",
                              "Text": "New",
                              "Command": "ground.forces.open_create_template",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Id": "gf_rename_template_btn",
                              "Text": "Rename",
                              "Command": "ground.forces.open_rename_template",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Id": "gf_copy_template_btn",
                              "Text": "Copy",
                              "Command": "ground.forces.open_copy_template",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Id": "gf_copy_upgrade_btn",
                              "Text": "Copy + Upgrade",
                              "Command": "ground.forces.copy_upgrade_template",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Id": "gf_as_text_btn",
                              "Text": "As Text",
                              "Command": "ground.forces.template_as_text",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Id": "gf_delete_template_btn",
                              "Text": "Delete",
                              "Command": "ground.forces.open_delete_template",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            },
                            {
                              "Type": "Button",
                              "Id": "gf_change_rank_btn",
                              "Text": "Change Rank",
                              "Command": "ground.forces.open_change_rank",
                              "Classes": [
                                "ps-btn--sm"
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "Grid",
                      "Grid.Row": 1,
                      "Grid.ColumnSpan": 2,
                      "ColumnDefinitions": [
                        "1fr",
                        "1fr"
                      ],
                      "Gap": 12,
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Grid.Column": 0,
                          "Orientation": "Vertical",
                          "Gap": 8,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Unit Type Details",
                              "Style": "Label.Subheading"
                            },
                            {
                              "Type": "ScrollBox",
                              "Axis": "Vertical",
                              "Height": "200px",
                              "Padding": "0",
                              "Background": "transparent",
                              "Children": [
                                {
                                  "Type": "PropertyGrid",
                                  "Id": "gf_unit_type_stats",
                                  "Sections": []
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "Type": "StackPanel",
                          "Grid.Column": 1,
                          "Orientation": "Vertical",
                          "Gap": 8,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Template Elements",
                              "Style": "Label.Subheading"
                            },
                            {
                              "Type": "DataGrid",
                              "Id": "gf_template_detail_grid",
                              "EnableVerticalScroll": true,
                              "SelectionMode": "Single",
                              "OnSelectionChanged": "ground.forces.select_template_element",
                              "Columns": [
                                {
                                  "Header": "Name",
                                  "Field": "name",
                                  "Flex": 1
                                },
                                {
                                  "Header": "Units",
                                  "Field": "units",
                                  "Width": "60px"
                                },
                                {
                                  "Header": "Size",
                                  "Field": "size",
                                  "Width": "60px"
                                },
                                {
                                  "Header": "Cost",
                                  "Field": "cost",
                                  "Width": "60px"
                                },
                                {
                                  "Header": "HP",
                                  "Field": "hp",
                                  "Width": "60px"
                                },
                                {
                                  "Header": "GSP",
                                  "Field": "gsp",
                                  "Width": "60px"
                                },
                                {
                                  "Header": "Element Attributes",
                                  "Field": "attributes",
                                  "Width": "160px"
                                }
                              ],
                              "Rows": [],
                              "Height": "200px"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Row": 2,
                      "Grid.ColumnSpan": 2,
                      "Orientation": "Horizontal",
                      "Gap": 8,
                      "Margin": "0 12 0 0",
                      "VerticalAlignment": "Center",
                      "Children": [
                        {
                          "Type": "Button",
                          "Text": "Rename Unit",
                          "Id": "gf_rename_unit_btn",
                          "Command": "ground.forces.open_rename_unit",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Obsolete",
                          "Id": "gf_obsolete_btn",
                          "Command": "ground.forces.toggle_template_obsolete",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_show_obsolete",
                          "Label": "Show Obsolete",
                          "Command": "ground.forces.toggle_template_filter"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_show_civilian",
                          "Label": "Show Civilian",
                          "Command": "ground.forces.toggle_template_filter"
                        },
                        {
                          "Type": "Button",
                          "Id": "gf_add_units_btn",
                          "Text": "Add Units",
                          "Command": "ground.forces.add_template_element",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Input",
                          "Id": "gf_template_units",
                          "Width": "60px",
                          "InputType": "Number",
                          "Value": "1",
                          "Command": "ground.forces.set_template_field"
                        },
                        {
                          "Type": "Button",
                          "Id": "gf_edit_amount_btn",
                          "Text": "Edit Amount",
                          "Command": "ground.forces.edit_template_element",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Id": "gf_delete_element_btn",
                          "Text": "Delete Element",
                          "Command": "ground.forces.remove_template_element",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        }
                      ]
                    }
                  ],
                  "Gap": 12
                },
                {
                  "Type": "Modal",
                  "Id": "gf_rename_unit_modal",
                  "Title": "Rename Unit Class",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_rename_unit",
                  "Width": "460px",
                  "Height": "140px",
                  "BadgeText": "Rename",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Orientation": "Horizontal",
                      "Gap": 12,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Name",
                          "VerticalAlignment": "Center",
                          "Width": "90px"
                        },
                        {
                          "Type": "Input",
                          "Id": "gf_rename_unit_name",
                          "Placeholder": "Unit Class Name",
                          "CommitOnInput": true,
                          "Command": "ground.forces.set_rename_unit_name",
                          "Flex": "1"
                        }
                      ]
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Rename",
                      "Command": "ground.forces.confirm_rename_unit",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_rename_unit"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_edit_element_modal",
                  "Title": "Edit Element Amount",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_edit_element",
                  "Width": "400px",
                  "Height": "180px",
                  "BadgeText": "Edit",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "Label",
                      "Id": "gf_edit_element_message",
                      "Text": "Edit element amount"
                    },
                    {
                      "Type": "Input",
                      "Id": "gf_edit_element_units",
                      "Placeholder": "1",
                      "Command": "ground.forces.set_edit_element_units",
                      "Width": "120px"
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Apply",
                      "Command": "ground.forces.confirm_edit_element",
                      "Style": "Primary"
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_edit_element"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_delete_element_modal",
                  "Title": "Delete Element",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_remove_element",
                  "Width": "420px",
                  "Height": "180px",
                  "BadgeText": "Delete",
                  "BadgeVariant": "warn",
                  "AccentVariant": "Warning",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "Label",
                      "Id": "gf_delete_element_message",
                      "Text": "Remove this unit class from the formation template?"
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Delete",
                      "Command": "ground.forces.confirm_remove_element",
                      "Classes": [
                        "ps-btn--warning"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_remove_element"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_create_template_modal",
                  "Title": "Create New Formation Template",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_create_template",
                  "Width": "460px",
                  "Height": "220px",
                  "BadgeText": "New Template",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Orientation": "Vertical",
                      "Gap": 12,
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Name",
                              "VerticalAlignment": "Center",
                              "Width": "90px"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_new_template_name",
                              "Placeholder": "New Formation",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_template_field",
                              "Flex": "1"
                            }
                          ]
                        },
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Abbreviation",
                              "VerticalAlignment": "Center",
                              "Width": "90px"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_new_template_abbr",
                              "Placeholder": "NF",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_template_field",
                              "Flex": "1"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Create",
                      "Command": "ground.forces.confirm_create_template",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_create_template"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_rename_template_modal",
                  "Title": "Rename Formation Template",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_rename_template",
                  "Width": "460px",
                  "Height": "220px",
                  "BadgeText": "Rename",
                  "BadgeVariant": "warning",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Orientation": "Vertical",
                      "Gap": 12,
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Name",
                              "VerticalAlignment": "Center",
                              "Width": "90px"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_rename_template_name",
                              "Placeholder": "Name",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_template_field",
                              "Flex": "1"
                            }
                          ]
                        },
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Abbreviation",
                              "VerticalAlignment": "Center",
                              "Width": "90px"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_rename_template_abbr",
                              "Placeholder": "ABR",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_template_field",
                              "Flex": "1"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Rename",
                      "Command": "ground.forces.confirm_rename_template",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_rename_template"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_copy_template_modal",
                  "Title": "Copy Formation Template",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_copy_template",
                  "Width": "460px",
                  "Height": "220px",
                  "BadgeText": "Copy",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Orientation": "Vertical",
                      "Gap": 12,
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Name",
                              "VerticalAlignment": "Center",
                              "Width": "90px"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_copy_template_name",
                              "Placeholder": "Name",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_template_field",
                              "Flex": "1"
                            }
                          ]
                        },
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Abbreviation",
                              "VerticalAlignment": "Center",
                              "Width": "90px"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_copy_template_abbr",
                              "Placeholder": "ABR",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_template_field",
                              "Flex": "1"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Copy",
                      "Command": "ground.forces.confirm_copy_template",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_copy_template"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_delete_template_modal",
                  "Title": "Delete Formation Template",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_delete_template",
                  "Width": "420px",
                  "Height": "180px",
                  "BadgeText": "Delete",
                  "BadgeVariant": "warn",
                  "AccentVariant": "Warning",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "Label",
                      "Id": "gf_delete_template_message",
                      "Text": "Are you sure you want to delete this formation template? This cannot be undone."
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Delete",
                      "Command": "ground.forces.confirm_delete_template",
                      "Classes": [
                        "ps-btn--warning"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_delete_template"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_change_rank_modal",
                  "Title": "Change Required Rank",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_change_rank",
                  "Width": "420px",
                  "Height": "200px",
                  "BadgeText": "Rank",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Orientation": "Horizontal",
                      "Gap": 12,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Required Rank",
                          "VerticalAlignment": "Center",
                          "Width": "120px"
                        },
                        {
                          "Type": "Select",
                          "Id": "gf_rank_select",
                          "Flex": "1",
                          "Options": [],
                          "Command": "ground.forces.set_rank"
                        }
                      ]
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Set Rank",
                      "Command": "ground.forces.confirm_change_rank",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_change_rank"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_template_text_modal",
                  "Title": "Template Unit List",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.close_template_text",
                  "Width": "420px",
                  "Height": "340px",
                  "BadgeText": "Template",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "Input",
                      "Id": "gf_template_text_content",
                      "ReadOnly": true,
                      "Multiline": true,
                      "Flex": "1",
                      "Value": ""
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Close",
                      "Command": "ground.forces.close_template_text"
                    }
                  ]
                }
              ]
            },
            {
              "Type": "TabItem",
              "Title": "Unit Class Design",
              "Children": [
                {
                  "Type": "Grid",
                  "Width": "100%",
                  "Height": "100%",
                  "ColumnDefinitions": [
                    "1fr",
                    "1fr",
                    "1fr",
                    "420px"
                  ],
                  "RowDefinitions": [
                    "auto",
                    "1fr",
                    "auto",
                    "auto"
                  ],
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 0,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Base Types",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "DataGrid",
                          "Id": "gf_base_type_grid",
                          "EnableVerticalScroll": true,
                          "SelectionMode": "Single",
                          "AllowSorting": false,
                          "OnSelectionChanged": "ground.forces.select_base_type",
                          "Columns": [
                            {
                              "Header": "Name",
                              "Field": "name",
                              "Flex": 1
                            },
                            {
                              "Header": "Size",
                              "Field": "size",
                              "Width": "60px"
                            },
                            {
                              "Header": "Hit Pts",
                              "Field": "hp",
                              "Width": "64px"
                            },
                            {
                              "Header": "Slots",
                              "Field": "slots",
                              "Width": "56px"
                            },
                            {
                              "Header": "Hit Mod",
                              "Field": "hit_mod",
                              "Width": "64px"
                            },
                            {
                              "Header": "Max Fort",
                              "Field": "max_fort",
                              "Width": "72px"
                            },
                            {
                              "Header": "Max SF",
                              "Field": "max_sf",
                              "Width": "64px"
                            }
                          ],
                          "Rows": []
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 1,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Armour",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "DataGrid",
                          "Id": "gf_armour_grid",
                          "EnableVerticalScroll": true,
                          "SelectionMode": "Single",
                          "OnSelectionChanged": "ground.forces.select_armour",
                          "Columns": [
                            {
                              "Header": "Armour Type",
                              "Field": "name",
                              "Flex": 1
                            },
                            {
                              "Header": "Base AR",
                              "Field": "base_ar",
                              "Width": "72px"
                            },
                            {
                              "Header": "Racial AR",
                              "Field": "racial_ar",
                              "Width": "72px"
                            }
                          ],
                          "Rows": [],
                          "AllowSorting": false
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 2,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Capabilities",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "DataGrid",
                          "Id": "gf_capability_grid",
                          "EnableVerticalScroll": true,
                          "SelectionMode": "Multiple",
                          "AllowSorting": false,
                          "Columns": [
                            {
                              "Header": "Capability",
                              "Field": "name",
                              "Flex": 1
                            },
                            {
                              "Header": "Cost",
                              "Field": "cost",
                              "Width": "64px"
                            },
                            {
                              "Header": "Inf Only",
                              "Field": "inf_only",
                              "Width": "64px"
                            }
                          ],
                          "Rows": [],
                          "OnSelectionChanged": "ground.forces.select_capability"
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 3,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Existing Unit Classes",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "DataGrid",
                          "Id": "gf_unit_class_grid",
                          "EnableVerticalScroll": true,
                          "SelectionMode": "None",
                          "Columns": [
                            {
                              "Header": "Name",
                              "Field": "name",
                              "Flex": 1
                            },
                            {
                              "Header": "Base",
                              "Field": "baseType",
                              "Width": "110px"
                            },
                            {
                              "Header": "Cost",
                              "Field": "cost",
                              "Width": "70px"
                            },
                            {
                              "Header": "Size",
                              "Field": "size",
                              "Width": "70px"
                            }
                          ],
                          "Rows": [],
                          "FooterLeftText": ""
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Row": 1,
                      "Grid.ColumnSpan": 3,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Margin": "0 12 0 0",
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Components",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "DataGrid",
                          "Id": "gf_component_type_grid",
                          "EnableVerticalScroll": true,
                          "SelectionMode": "Single",
                          "AllowSorting": false,
                          "Columns": [
                            {
                              "Header": "Component Type",
                              "Field": "name",
                              "Flex": 1
                            },
                            {
                              "Header": "Abbrev",
                              "Field": "abbrev",
                              "Width": "80px"
                            },
                            {
                              "Header": "Size",
                              "Field": "size",
                              "Width": "60px"
                            },
                            {
                              "Header": "AP",
                              "Field": "ap",
                              "Width": "60px"
                            },
                            {
                              "Header": "Dmg",
                              "Field": "dmg",
                              "Width": "60px"
                            },
                            {
                              "Header": "Shots",
                              "Field": "shots",
                              "Width": "60px"
                            },
                            {
                              "Header": "GSP",
                              "Field": "gsp",
                              "Width": "60px"
                            },
                            {
                              "Header": "Component Attributes",
                              "Field": "attributes",
                              "Width": "200px"
                            }
                          ],
                          "Rows": [],
                          "Height": "100%",
                          "OnSelectionChanged": "ground.forces.select_component_type"
                        },
                        {
                          "Type": "StackPanel",
                          "Id": "gf_sto_weapon_panel",
                          "IsVisible": false,
                          "Orientation": "Vertical",
                          "Gap": 6,
                          "Margin": "0 0 0 0",
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "STO Weapon Design",
                              "Style": "Label.Subheading"
                            },
                            {
                              "Type": "DataGrid",
                              "Id": "gf_sto_weapon_grid",
                              "EnableVerticalScroll": true,
                              "SelectionMode": "Single",
                              "AllowSorting": false,
                              "Height": "220px",
                              "OnSelectionChanged": "ground.forces.select_sto_weapon",
                              "Columns": [
                                {
                                  "Header": "Weapon",
                                  "Field": "name",
                                  "Flex": 1
                                },
                                {
                                  "Header": "Range",
                                  "Field": "range",
                                  "Width": "80px"
                                },
                                {
                                  "Header": "Tracking",
                                  "Field": "tracking",
                                  "Width": "80px"
                                },
                                {
                                  "Header": "Recharge",
                                  "Field": "recharge",
                                  "Width": "80px"
                                },
                                {
                                  "Header": "Damage",
                                  "Field": "damage",
                                  "Width": "70px"
                                },
                                {
                                  "Header": "Shots",
                                  "Field": "shots",
                                  "Width": "60px"
                                },
                                {
                                  "Header": "Size",
                                  "Field": "size",
                                  "Width": "70px"
                                },
                                {
                                  "Header": "Cost",
                                  "Field": "cost",
                                  "Width": "70px"
                                }
                              ],
                              "Rows": [],
                              "FooterLeftText": "No beam weapons designed."
                            },
                            {
                              "Type": "StackPanel",
                              "Orientation": "Horizontal",
                              "Gap": 24,
                              "Children": [
                                {
                                  "Type": "Checkbox",
                                  "Id": "gf_point_defence",
                                  "IsVisible": false,
                                  "Label": "Point Defence Weapon",
                                  "Command": "ground.forces.toggle_unit_flag",
                                  "Classes": [
                                    "ps-checkbox--nowrap"
                                  ]
                                },
                                {
                                  "Type": "Checkbox",
                                  "Id": "gf_include_eccm",
                                  "Label": "Include ECCM",
                                  "Command": "ground.forces.toggle_unit_flag",
                                  "Classes": [
                                    "ps-checkbox--nowrap"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Row": 2,
                      "Grid.ColumnSpan": 4,
                      "Orientation": "Horizontal",
                      "VerticalAlignment": "Center",
                      "Gap": 12,
                      "Margin": "8 8 0 0",
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Additional Components:",
                          "VerticalAlignment": "Center"
                        },
                        {
                          "Type": "Select",
                          "Id": "gf_component_b",
                          "Width": "260px",
                          "Command": "ground.forces.select_component",
                          "Options": []
                        },
                        {
                          "Type": "Select",
                          "Id": "gf_component_c",
                          "Width": "260px",
                          "IsVisible": false,
                          "Command": "ground.forces.select_component",
                          "Options": []
                        },
                        {
                          "Type": "Select",
                          "Id": "gf_component_d",
                          "Width": "260px",
                          "IsVisible": false,
                          "Command": "ground.forces.select_component",
                          "Options": []
                        }
                      ],
                      "Id": "gf_additional_components_row"
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Row": 1,
                      "Grid.Column": 3,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Padding": "0 0 0 0",
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "VerticalAlignment": "Center",
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Name"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_unit_name",
                              "Placeholder": "Infantry Squad",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_unit_name",
                              "Width": "100%"
                            },
                            {
                              "Type": "Checkbox",
                              "Id": "gf_non_combat",
                              "Label": "Avoid Combat",
                              "Command": "ground.forces.toggle_unit_flag",
                              "Classes": [
                                "ps-checkbox--nowrap"
                              ]
                            }
                          ]
                        },
                        {
                          "Type": "ScrollBox",
                          "Axis": "Vertical",
                          "Width": "100%",
                          "Height": "1fr",
                          "Padding": "0",
                          "Background": "transparent",
                          "Children": [
                            {
                              "Type": "PropertyGrid",
                              "Id": "gf_unit_class_stats",
                              "Sections": []
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Row": 3,
                      "Grid.ColumnSpan": 4,
                      "Orientation": "Horizontal",
                      "HorizontalAlignment": "Right",
                      "Gap": 8,
                      "Margin": "8 8 0 0",
                      "Children": [
                        {
                          "Type": "Button",
                          "Id": "gf_sm_instant_unit",
                          "Text": "Instant",
                          "Command": "ground.forces.sm_instant_unit_class",
                          "Style": "SpaceMaster",
                          "IsVisible": false
                        },
                        {
                          "Type": "Button",
                          "Id": "gf_create_unit_class",
                          "Text": "Create",
                          "Command": "ground.forces.create_unit_class",
                          "Classes": [
                            "ps-btn--primary"
                          ]
                        }
                      ]
                    }
                  ],
                  "Gap": 12
                },
                {
                  "Type": "Modal",
                  "Id": "gf_warn_modal",
                  "Title": "Unit Class Design",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.dismiss_warn",
                  "Width": "480px",
                  "Height": "200px",
                  "BadgeText": "Warning",
                  "BadgeVariant": "warn",
                  "AccentVariant": "Warning",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "Label",
                      "Id": "gf_warn_message",
                      "Text": ""
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Dismiss",
                      "Command": "ground.forces.dismiss_warn",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "Type": "TabItem",
              "Title": "STO Targeting",
              "Children": [
                {
                  "Type": "StackPanel",
                  "Orientation": "Vertical",
                  "Gap": 12,
                  "Width": "100%",
                  "Height": "100%",
                  "Children": [
                    {
                      "Type": "DataGrid",
                      "Id": "gf_sto_grid",
                      "Height": "1fr",
                      "EnableVerticalScroll": true,
                      "SelectionMode": "Single",
                      "OnSelectionChanged": "ground.forces.select_sto_element",
                      "Columns": [
                        {
                          "Header": "Parent Formation",
                          "Field": "formation",
                          "Flex": 1
                        },
                        {
                          "Header": "Location",
                          "Field": "location",
                          "Width": "180px"
                        },
                        {
                          "Header": "Element Class",
                          "Field": "elementClass",
                          "Width": "180px"
                        },
                        {
                          "Header": "Weapon",
                          "Field": "weapon",
                          "Width": "180px"
                        },
                        {
                          "Header": "Target Type",
                          "Field": "targetType",
                          "Width": "160px"
                        },
                        {
                          "Header": "WPT",
                          "Field": "wpt",
                          "Width": "70px"
                        },
                        {
                          "Header": "Units",
                          "Field": "units",
                          "Width": "70px"
                        },
                        {
                          "Header": "Range km",
                          "Field": "range",
                          "Width": "90px"
                        },
                        {
                          "Header": "Damage",
                          "Field": "damage",
                          "Width": "80px"
                        },
                        {
                          "Header": "ROF",
                          "Field": "rof",
                          "Width": "70px"
                        }
                      ],
                      "Rows": []
                    },
                    {
                      "Type": "StackPanel",
                      "Orientation": "Horizontal",
                      "Gap": 12,
                      "VerticalAlignment": "Center",
                      "Children": [
                        {
                          "Type": "Select",
                          "Id": "gf_sto_targeting_mode",
                          "Width": "240px",
                          "Options": [],
                          "Command": "ground.forces.set_sto_targeting_mode"
                        },
                        {
                          "Type": "Label",
                          "Text": "Weapons Per Target (0 = All)",
                          "VerticalAlignment": "Center",
                          "Classes": [
                            "ps-text-secondary"
                          ]
                        },
                        {
                          "Type": "Input",
                          "Id": "gf_sto_distribution",
                          "Width": "90px",
                          "InputType": "Number",
                          "Value": "0",
                          "Command": "ground.forces.set_sto_fire_distribution"
                        },
                        {
                          "Type": "Label",
                          "Id": "gf_sto_summary",
                          "Text": "No STO-capable formations deployed.",
                          "Classes": [
                            "ps-text-secondary"
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "Type": "TabItem",
              "Title": "Unit Series",
              "Children": [
                {
                  "Type": "Grid",
                  "Width": "100%",
                  "Height": "100%",
                  "ColumnDefinitions": [
                    "1fr",
                    "1fr",
                    "1fr"
                  ],
                  "RowDefinitions": [
                    "1fr",
                    "auto"
                  ],
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 0,
                      "Grid.RowSpan": 2,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Series",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "Label",
                          "Text": "Drag classes here to assign. Drop a member on empty space to unassign.",
                          "Classes": [
                            "ps-text-secondary"
                          ],
                          "Wrap": true
                        },
                        {
                          "Type": "Tree",
                          "Id": "gf_series_tree",
                          "DragDropEnabled": true,
                          "AllowReorder": true,
                          "DropGroupId": "gf_unit_series",
                          "OnNodeMoved": "ground.forces.series_assign_or_move",
                          "OnSelectionChanged": "ground.forces.select_series_node",
                          "Flex": "1",
                          "Nodes": []
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 1,
                      "Grid.RowSpan": 2,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Unassigned Unit Classes",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "Label",
                          "Text": "Drag a class into a series on the left.",
                          "Classes": [
                            "ps-text-secondary"
                          ],
                          "Wrap": true
                        },
                        {
                          "Type": "Tree",
                          "Id": "gf_unassigned_tree",
                          "DragDropEnabled": true,
                          "DropGroupId": "gf_unit_series",
                          "OnNodeMoved": "ground.forces.series_unassign",
                          "OnSelectionChanged": "ground.forces.select_unassigned_class",
                          "Flex": "1",
                          "Nodes": []
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 2,
                      "Grid.Row": 0,
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Class Details",
                          "Style": "Label.Subheading"
                        },
                        {
                          "Type": "Panel",
                          "Id": "gf_series_readout_glass",
                          "Width": "100%",
                          "Classes": [
                            "ps-panel",
                            "ps-panel--glass"
                          ],
                          "Children": [
                            {
                              "Type": "PropertyGrid",
                              "Id": "gf_series_readout",
                              "Sections": []
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 2,
                      "Grid.Row": 1,
                      "Orientation": "Horizontal",
                      "Gap": 8,
                      "HorizontalAlignment": "Center",
                      "Children": [
                        {
                          "Type": "Button",
                          "Text": "Create Series",
                          "Command": "ground.forces.open_create_series",
                          "Classes": [
                            "ps-btn--primary"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Rename Series",
                          "Command": "ground.forces.open_rename_series"
                        },
                        {
                          "Type": "Button",
                          "Text": "Delete Series",
                          "Command": "ground.forces.open_delete_series",
                          "Classes": [
                            "ps-btn--danger"
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "Modal",
                      "Id": "gf_create_series_modal",
                      "Title": "Create Unit Series",
                      "IsVisible": false,
                      "CloseOnEscape": true,
                      "CloseOnBackdropClick": true,
                      "CloseCommand": "ground.forces.cancel_create_series",
                      "Width": "420px",
                      "Height": "180px",
                      "BadgeText": "New Series",
                      "BadgeVariant": "info",
                      "AccentVariant": "Primary",
                      "DisplayMode": "Glow",
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Name",
                              "VerticalAlignment": "Center",
                              "Width": "80px"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_new_series_name",
                              "Placeholder": "New Series",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_series_field",
                              "Flex": "1"
                            }
                          ]
                        }
                      ],
                      "FooterChildren": [
                        {
                          "Type": "Button",
                          "Text": "Create",
                          "Command": "ground.forces.confirm_create_series",
                          "Classes": [
                            "ps-btn--primary"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Cancel",
                          "Command": "ground.forces.cancel_create_series"
                        }
                      ]
                    },
                    {
                      "Type": "Modal",
                      "Id": "gf_rename_series_modal",
                      "Title": "Rename Unit Series",
                      "IsVisible": false,
                      "CloseOnEscape": true,
                      "CloseOnBackdropClick": true,
                      "CloseCommand": "ground.forces.cancel_rename_series",
                      "Width": "420px",
                      "Height": "180px",
                      "BadgeText": "Rename",
                      "BadgeVariant": "info",
                      "AccentVariant": "Primary",
                      "DisplayMode": "Glow",
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Orientation": "Horizontal",
                          "Gap": 12,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Name",
                              "VerticalAlignment": "Center",
                              "Width": "80px"
                            },
                            {
                              "Type": "Input",
                              "Id": "gf_rename_series_name",
                              "CommitOnInput": true,
                              "Command": "ground.forces.set_series_field",
                              "Flex": "1"
                            }
                          ]
                        }
                      ],
                      "FooterChildren": [
                        {
                          "Type": "Button",
                          "Text": "Rename",
                          "Command": "ground.forces.confirm_rename_series",
                          "Classes": [
                            "ps-btn--primary"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Cancel",
                          "Command": "ground.forces.cancel_rename_series"
                        }
                      ]
                    },
                    {
                      "Type": "Modal",
                      "Id": "gf_delete_series_modal",
                      "Title": "Delete Unit Series",
                      "IsVisible": false,
                      "CloseOnEscape": true,
                      "CloseOnBackdropClick": true,
                      "CloseCommand": "ground.forces.cancel_delete_series",
                      "Width": "420px",
                      "Height": "170px",
                      "BadgeText": "Delete",
                      "BadgeVariant": "danger",
                      "AccentVariant": "Danger",
                      "DisplayMode": "Glow",
                      "Children": [
                        {
                          "Type": "Label",
                          "Id": "gf_delete_series_message",
                          "Text": "Delete this series and unassign all its member classes?",
                          "Wrap": true
                        }
                      ],
                      "FooterChildren": [
                        {
                          "Type": "Button",
                          "Text": "Delete",
                          "Command": "ground.forces.confirm_delete_series",
                          "Classes": [
                            "ps-btn--danger"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Cancel",
                          "Command": "ground.forces.cancel_delete_series"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "Type": "TabItem",
              "Title": "Organizations",
              "Children": [
                {
                  "Type": "Grid",
                  "Width": "100%",
                  "Height": "100%",
                  "ColumnDefinitions": [
                    "1fr"
                  ],
                  "RowDefinitions": [
                    "auto",
                    "1fr",
                    "auto"
                  ],
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Grid.Row": 0,
                      "Grid.ColumnSpan": 3,
                      "Orientation": "Horizontal",
                      "Gap": 8,
                      "Margin": "0 0 0 8px",
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Organization Blueprint - design a formation hierarchy, then Construct/Instant Org to build it.",
                          "Style": "Label.Subheading",
                          "Classes": [
                            "ps-text-secondary"
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "Grid",
                      "Width": "100%",
                      "Height": "100%",
                      "Grid.Row": 1,
                      "ColumnDefinitions": [
                        "1fr",
                        "1fr",
                        "340px"
                      ],
                      "RowDefinitions": [
                        "1fr"
                      ],
                      "Children": [
                        {
                          "Type": "StackPanel",
                          "Grid.Column": 0,
                          "Orientation": "Vertical",
                          "Gap": 4,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Organization Structure",
                              "Style": "Label.Subheading"
                            },
                            {
                              "Type": "Tree",
                              "Id": "gf_org_tree",
                              "Flex": "1",
                              "FullRowToggle": false,
                              "DropGroupId": "gf_org",
                              "OnNodeMoved": "ground.forces.org_drop",
                              "EnableVerticalScroll": true
                            }
                          ]
                        },
                        {
                          "Type": "StackPanel",
                          "Grid.Column": 1,
                          "Orientation": "Vertical",
                          "Gap": 4,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Available Formations",
                              "Style": "Label.Subheading"
                            },
                            {
                              "Type": "Tree",
                              "Id": "gf_org_template_tree",
                              "Flex": "1",
                              "FullRowToggle": false,
                              "DropGroupId": "gf_org",
                              "OnNodeMoved": "ground.forces.org_drop",
                              "EnableVerticalScroll": true
                            }
                          ]
                        },
                        {
                          "Type": "StackPanel",
                          "Grid.Column": 2,
                          "Orientation": "Vertical",
                          "Gap": 4,
                          "Children": [
                            {
                              "Type": "Label",
                              "Text": "Summary",
                              "Style": "Label.Subheading"
                            },
                            {
                              "Type": "PropertyGrid",
                              "Id": "gf_org_summary",
                              "Sections": [],
                              "MaxHeight": "600px"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Orientation": "Horizontal",
                      "Gap": 8,
                      "Grid.Row": 1,
                      "Grid.ColumnSpan": 3,
                      "VerticalAlignment": "Center",
                      "Children": [
                        {
                          "Type": "Button",
                          "Text": "Create Org",
                          "Command": "ground.forces.open_create_org",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Field Position",
                          "Command": "ground.forces.open_org_field_position",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Delete Node",
                          "Command": "ground.forces.delete_org_node",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Construct Org",
                          "Command": "ground.forces.construct_org",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Button",
                          "Text": "Instant Org",
                          "Command": "ground.forces.instant_org",
                          "Classes": [
                            "ps-btn--sm"
                          ]
                        },
                        {
                          "Type": "Select",
                          "Id": "gf_org_colony_select",
                          "Width": "200px",
                          "Command": "ground.forces.set_org_colony",
                          "Placeholder": "Select colony"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_org_enter_names",
                          "Label": "Enter Names",
                          "Command": "ground.forces.toggle_org_enter_names"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_org_priority",
                          "Label": "Priority"
                        },
                        {
                          "Type": "Label",
                          "Text": "Dragging a node with no parent copies it; a node with a parent moves it.",
                          "Classes": [
                            "ps-text-secondary"
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_create_org_modal",
                  "Title": "Create Organization Node",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_create_org",
                  "Width": "460px",
                  "Height": "140px",
                  "BadgeText": "Create",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Orientation": "Horizontal",
                      "Gap": 12,
                      "Children": [
                        {
                          "Type": "Label",
                          "Text": "Name",
                          "VerticalAlignment": "Center",
                          "Width": "90px"
                        },
                        {
                          "Type": "Input",
                          "Id": "gf_create_org_name",
                          "Placeholder": "Organization Name",
                          "CommitOnInput": true,
                          "Command": "ground.forces.set_create_org_name",
                          "Flex": "1"
                        }
                      ]
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Create",
                      "Command": "ground.forces.confirm_create_org",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_create_org"
                    }
                  ]
                },
                {
                  "Type": "Modal",
                  "Id": "gf_org_field_position_modal",
                  "Title": "Field Position",
                  "IsVisible": false,
                  "CloseOnEscape": true,
                  "CloseOnBackdropClick": true,
                  "CloseCommand": "ground.forces.cancel_org_field_position",
                  "Width": "460px",
                  "Height": "260px",
                  "BadgeText": "Field",
                  "BadgeVariant": "info",
                  "AccentVariant": "Primary",
                  "DisplayMode": "Glow",
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Orientation": "Vertical",
                      "Gap": 8,
                      "Children": [
                        {
                          "Type": "Select",
                          "Id": "gf_org_field_position_value",
                          "Command": "ground.forces.set_org_field_position_value",
                          "Options": [
                            {
                              "Label": "Frontline Defence",
                              "Value": "FrontlineDefence"
                            },
                            {
                              "Label": "Frontline Attack",
                              "Value": "FrontlineAttack"
                            },
                            {
                              "Label": "Support",
                              "Value": "Support"
                            },
                            {
                              "Label": "Rear Echelon",
                              "Value": "RearEchelon"
                            }
                          ]
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_org_field_position_subordinates",
                          "Label": "Set Field Position for all Subordinate Nodes",
                          "Command": "ground.forces.toggle_org_field_position_sub"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_org_field_position_only_subordinates",
                          "Label": "Set Field Position ONLY for Subordinate Nodes",
                          "Command": "ground.forces.toggle_org_field_position_only_sub"
                        },
                        {
                          "Type": "Checkbox",
                          "Id": "gf_org_field_position_all_same_template",
                          "Label": "Set all Templates of this type in any org structure",
                          "Command": "ground.forces.toggle_org_field_position_all"
                        }
                      ]
                    }
                  ],
                  "FooterChildren": [
                    {
                      "Type": "Button",
                      "Text": "Apply",
                      "Command": "ground.forces.confirm_org_field_position",
                      "Classes": [
                        "ps-btn--primary"
                      ]
                    },
                    {
                      "Type": "Button",
                      "Text": "Cancel",
                      "Command": "ground.forces.cancel_org_field_position"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
