<Window 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="514 MSG SCO Administration Tool" Height="1050" Width="1425" MinWidth="1280" WindowStartupLocation="CenterScreen" Background="#F0F0F0">
    <Grid Margin="10">
        <TabControl Name="MainTabControl" Background="White">

            <TabItem Header="Computer Management" Name="TabComputer">
                <Grid Margin="15">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="220"/>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="1.25*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="180"/>
                    </Grid.RowDefinitions>

                    <!-- LEFT COLUMN: ACTIONS -->
                    <GroupBox Header="Select Action" Grid.Column="0" Grid.Row="0" Margin="0,0,15,0" FontWeight="Bold">
                        <StackPanel Margin="10" TextElement.FontWeight="Normal">
                            <RadioButton Name="RadGet" Content="Get Computer Info" IsChecked="True" Margin="0,8"/>
                            <RadioButton Name="RadEnable" Content="Enable Computer" Margin="0,8"/>
                            <RadioButton Name="RadDisable" Content="Disable Computer" Margin="0,8"/>
                            <RadioButton Name="RadReset" Content="Reset Computer" Margin="0,8"/>
                            <Separator Margin="0,10"/>
                            <RadioButton Name="RadNew" Content="Create New Computer" Margin="0,8"/>
                            <RadioButton Name="RadRemove" Content="Remove Computer" Margin="0,8" Foreground="DarkRed"/>
                            <CheckBox Name="ChkRecycleBin" Content="Include Recycle Bin" Margin="20,0,0,0" IsEnabled="False" FontStyle="Italic"/>
                        </StackPanel>
                    </GroupBox>

                    <!-- CENTER COLUMN: INPUTS -->
                    <Grid Grid.Column="1" Grid.Row="0" Margin="0,0,15,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <!-- Naming Convention Settings -->
                        <GroupBox Header="Naming Convention, Import, and Quick Links" Grid.Row="0" FontWeight="Bold" Margin="0,0,0,10">
                            <StackPanel Margin="10" TextElement.FontWeight="Normal">
                                <Grid Margin="0,0,0,10">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="60"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="150"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="45"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Text="Prefix:" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,5,0"/>
                                    <TextBox Name="TxtPrefix" Grid.Column="1" Margin="0,0,10,0" CharacterCasing="Upper"/>

                                    <TextBlock Text="Type:" Grid.Column="2" VerticalAlignment="Center" Margin="0,0,5,0"/>
                                    <ComboBox Name="CmbDeviceType" Grid.Column="3" Margin="0,0,10,0">
                                        <ComboBoxItem Content="W - Workstation"/>
                                        <ComboBoxItem Content="L - Laptop"/>
                                        <ComboBoxItem Content="T - Tablet"/>
                                        <ComboBoxItem Content="V - Virtual Machine"/>
                                    </ComboBox>

                                    <TextBlock Text="SN Digits:" Grid.Column="4" VerticalAlignment="Center" Margin="0,0,5,0"/>
                                    <TextBox Name="TxtSnDigits" Grid.Column="5"/>
                                </Grid>

                                <WrapPanel>
                                    <Button Name="BtnImport" Content="Import File (.txt, .csv, .xlsx)" Width="220" Height="28" Margin="0,0,8,8"/>
                                    <Button Name="BtnISEPrimary" Content="CISCO ISE Primary" Width="145" Height="28" Margin="0,0,8,8" Background="#005A9C" Foreground="White"/>
                                    <Button Name="BtnISEBackup" Content="CISCO ISE Backup" Width="145" Height="28" Margin="0,0,8,8" Background="#6C757D" Foreground="White"/>
                                    <Button Name="BtnRefreshInventory" Content="Reload Inventory" Width="130" Height="28" Margin="0,0,16,8"/>
                                    <CheckBox Name="ChkDevMode" Content="DEV Mode" VerticalAlignment="Center" FontWeight="Bold" Margin="0,2,0,0"/>
                                </WrapPanel>
                            </StackPanel>
                        </GroupBox>

<!-- Target Computers -->
<GroupBox Header="Target Computer(s)" Grid.Row="1" FontWeight="Bold">
    <Grid Margin="10" TextElement.FontWeight="Normal">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <TextBlock Text="Enter serials/names (Press ENTER to format). Click an item in the target list to view inventory details." 
                   Foreground="Gray" Margin="0,0,0,5" Grid.Row="0" TextWrapping="Wrap"/>
        
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1.3*"/>
                <ColumnDefinition Width="12"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>
            
            <TextBox Name="TxtComputerNames" Grid.Column="0" MinHeight="220" 
                     TextWrapping="Wrap" AcceptsReturn="True" 
                     VerticalScrollBarVisibility="Auto" 
                     VerticalContentAlignment="Top" CharacterCasing="Upper"/>
            
            <ListView Name="LstTargets" Grid.Column="2" MinHeight="220" FontFamily="Consolas">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Width="30">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Center"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Computer Name" DisplayMemberBinding="{Binding Name}" Width="180"/>
                    </GridView>
                </ListView.View>
            </ListView>
        </Grid>
        
        <!-- Buttons row with both buttons -->
        <WrapPanel Grid.Row="2" Margin="0,5,0,0" HorizontalAlignment="Right">
            <Button Name="BtnPopulateFromInventory" Content="← Populate from Selected" 
                    Height="26" Width="150" Margin="0,0,10,0"/>
            <Button Name="BtnSelectAll" Content="Select All" 
                    Height="26" Width="100"/>
        </WrapPanel>
    </Grid>
</GroupBox>

                        <!-- New Computer Details -->
                        <GroupBox Name="GrpNewDetails" Header="New Computer Details" Grid.Row="2" Margin="0,10,0,0" FontWeight="Bold" IsEnabled="False">
                            <Grid Margin="10" TextElement.FontWeight="Normal">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <TextBlock Text="OS:" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                                <TextBox Name="TxtOS" Grid.Row="0" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                                <TextBlock Text="Computer Model:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                                <TextBox Name="TxtModel" Grid.Row="1" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                                <TextBlock Text="Organization:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                                <ComboBox Name="CmbOrg" Grid.Row="2" Grid.Column="1" Margin="0,3" IsEditable="True" IsTextSearchEnabled="True" StaysOpenOnEdit="True"/>

                                <TextBlock Text="Building Number:" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                                <TextBox Name="TxtBldg" Grid.Row="3" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                                <TextBlock Text="Room Number:" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                                <TextBox Name="TxtRoom" Grid.Row="4" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                                <TextBlock Text="Extension:" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                                <TextBox Name="TxtExt" Grid.Row="5" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                                <TextBlock Text="Description:" Grid.Row="6" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3" FontWeight="Bold"/>
                                <TextBox Name="TxtDesc" Grid.Row="6" Grid.Column="1" Margin="0,3" Background="#E8E8E8" CharacterCasing="Upper"/>                            
							
							</Grid>
                        </GroupBox>
                    </Grid>

                    <!-- RIGHT COLUMN: INVENTORY DETAILS -->
                    <GroupBox Header="Inventory / Equipment Custodian Details" Grid.Column="2" Grid.Row="0" FontWeight="Bold">
                        <Grid Margin="10" TextElement.FontWeight="Normal">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>  <!-- Short Name row -->
								<RowDefinition Height="*"/>
								<RowDefinition Height="Auto"/>  <!-- Button row -->
							</Grid.RowDefinitions>

                            <TextBlock Text="Status:" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3" FontWeight="Bold"/>
                            <TextBox Name="TxtInvStatus" Grid.Row="0" Grid.Column="1" Margin="0,3" Background="#E8E8E8" IsReadOnly="True"/>

                            <TextBlock Text="Equipment Custodian:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvCustodian" Grid.Row="1" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <TextBlock Text="Unit / Organization:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvUnit" Grid.Row="2" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <TextBlock Text="Duty Phone:" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvDutyPhone" Grid.Row="3" Grid.Column="1" Margin="0,3"/>

                            <TextBlock Text="Building:" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvBuilding" Grid.Row="4" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <TextBlock Text="Room:" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvRoom" Grid.Row="5" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <TextBlock Text="Serial Number:" Grid.Row="6" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvSerial" Grid.Row="6" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <TextBlock Text="Computer Name:" Grid.Row="7" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvComputerName" Grid.Row="7" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <TextBlock Text="Replaced:" Grid.Row="8" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvReplaced" Grid.Row="8" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <TextBlock Text="Type / Model:" Grid.Row="9" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvType" Grid.Row="9" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <TextBlock Text="MAC Address:" Grid.Row="10" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3" FontWeight="Bold"/>
                            <TextBox Name="TxtInvMAC" Grid.Row="10" Grid.Column="1" Margin="0,3" CharacterCasing="Upper" Foreground="Red" FontWeight="Bold"/>

                            <TextBlock Text="Series:" Grid.Row="11" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
                            <TextBox Name="TxtInvSeries" Grid.Row="11" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

							<TextBlock Text="Short Name:" Grid.Row="12" Grid.Column="0" VerticalAlignment="Center" Margin="0,3,10,3"/>
							<TextBox Name="TxtInvShortName" Grid.Row="12" Grid.Column="1" Margin="0,3" CharacterCasing="Upper"/>

                            <Border Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2" Padding="0,10,0,0">
                                <Button Name="BtnAddInventory" Content="Add / Append Inventory Entry" Height="32" FontWeight="Bold" Background="#198754" Foreground="White"/>
                            </Border>
                        </Grid>
                    </GroupBox>

                    <!-- BOTTOM MIDDLE: EXECUTE & PROGRESS -->
                    <Grid Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="1" Margin="0,15">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <ProgressBar Name="ProgBar" Grid.Column="0" Height="25" Margin="0,0,15,0" Minimum="0" Maximum="100"/>
                        <Button Name="BtnExecute" Grid.Column="1" Content="Execute Action" Width="150" Height="35" FontWeight="Bold" Background="#005A9C" Foreground="White"/>
                    </Grid>

                    <!-- BOTTOM: OUTPUT CONSOLE -->
                    <GroupBox Header="Output / Logs" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="2" FontWeight="Bold">
                        <RichTextBox Name="TxtOutput" 
                                     IsReadOnly="True" 
                                     VerticalScrollBarVisibility="Auto" 
                                     HorizontalScrollBarVisibility="Auto"
                                     FontFamily="Consolas" 
                                     FontSize="10"
                                     Background="#1E1E1E" 
                                     Foreground="#D4D4D4"
                                     Margin="5">
                            <RichTextBox.Resources>
                                <Style TargetType="{x:Type Paragraph}">
                                    <Setter Property="Margin" Value="0"/>
                                </Style>
                            </RichTextBox.Resources>
                        </RichTextBox>
                    </GroupBox>
                </Grid>
            </TabItem>

            <TabItem Header="User Management" Name="TabUser" IsEnabled="False">
                <TextBlock Text="User Management Module Coming Soon..." HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Foreground="Gray"/>
            </TabItem>

        </TabControl>
    </Grid>
</Window>
