<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="view_fusion_claims_dashboard_form" model="ir.ui.view">
        <field name="name">fusion.claims.dashboard.form</field>
        <field name="model">fusion.claims.dashboard</field>
        <field name="arch" type="xml">
            <form string="Dashboard" create="0" delete="0">
                <sheet>
                    <!-- ===== FUNDING CARDS (one line, bigger) ===== -->
                    <div class="d-flex flex-nowrap gap-2 mb-4 overflow-auto">
                        <div invisible="adp_count == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_adp" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="adp_count"/></div>
                                    <div style="font-size: 0.85rem;">ADP</div>
                                </div>
                            </button>
                        </div>
                        <div invisible="odsp_count == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_odsp" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="odsp_count"/></div>
                                    <div style="font-size: 0.85rem;">ODSP</div>
                                </div>
                            </button>
                        </div>
                        <div invisible="march_of_dimes_count == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_march" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="march_of_dimes_count"/></div>
                                    <div style="font-size: 0.85rem;">March of Dimes</div>
                                </div>
                            </button>
                        </div>
                        <div invisible="hardship_count == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_hardship" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="hardship_count"/></div>
                                    <div style="font-size: 0.85rem;">Hardship</div>
                                </div>
                            </button>
                        </div>
                        <div invisible="acsd_count == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_acsd" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="acsd_count"/></div>
                                    <div style="font-size: 0.85rem;">ACSD</div>
                                </div>
                            </button>
                        </div>
                        <div invisible="muscular_dystrophy_count == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_muscular" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="muscular_dystrophy_count"/></div>
                                    <div style="font-size: 0.85rem;">Muscular Dystrophy</div>
                                </div>
                            </button>
                        </div>
                        <div invisible="insurance_count == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_insurance" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-dark text-center py-3 px-2" style="background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="insurance_count"/></div>
                                    <div style="font-size: 0.85rem;">Insurance</div>
                                </div>
                            </button>
                        </div>
                        <div invisible="wsib_count == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_wsib" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-dark text-center py-3 px-2" style="background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="wsib_count"/></div>
                                    <div style="font-size: 0.85rem;">WSIB</div>
                                </div>
                            </button>
                        </div>
                        <div invisible="total_profiles == 0" style="flex: 1 1 0; min-width: 120px;">
                            <button name="action_open_profiles" type="object" class="btn p-0 w-100 border-0">
                                <div class="text-white text-center py-3 px-2" style="background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); border-radius: 14px;">
                                    <div class="fw-bold" style="font-size: 1.8rem;"><field name="total_profiles"/></div>
                                    <div style="font-size: 0.85rem;">Profiles</div>
                                </div>
                            </button>
                        </div>
                    </div>

                    <!-- ===== PANEL SELECTORS (4 dropdowns) ===== -->
                    <div class="row g-2 mb-3">
                        <div class="col-3">
                            <div class="fw-bold mb-1" style="font-size: 0.8rem;">Window 1</div>
                            <field name="panel1_type" nolabel="1"/>
                        </div>
                        <div class="col-3">
                            <div class="fw-bold mb-1" style="font-size: 0.8rem;">Window 2</div>
                            <field name="panel2_type" nolabel="1"/>
                        </div>
                        <div class="col-3">
                            <div class="fw-bold mb-1" style="font-size: 0.8rem;">Window 3</div>
                            <field name="panel3_type" nolabel="1"/>
                        </div>
                        <div class="col-3">
                            <div class="fw-bold mb-1" style="font-size: 0.8rem;">Window 4</div>
                            <field name="panel4_type" nolabel="1"/>
                        </div>
                    </div>

                    <!-- ===== TOP PANELS ROW 1 ===== -->
                    <div class="row g-3 mb-3">
                        <div class="col-12 col-lg-6">
                            <div class="card" style="border-radius: 14px; overflow: hidden;">
                                <div class="card-header fw-bold text-white py-2" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
                                    <field name="panel1_title" nolabel="1"/>
                                </div>
                                <div class="card-body p-0" style="max-height: 400px; overflow-y: auto;">
                                    <field name="panel1_html" class="w-100" nolabel="1"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-12 col-lg-6">
                            <div class="card" style="border-radius: 14px; overflow: hidden;">
                                <div class="card-header fw-bold text-white py-2" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
                                    <field name="panel2_title" nolabel="1"/>
                                </div>
                                <div class="card-body p-0" style="max-height: 400px; overflow-y: auto;">
                                    <field name="panel2_html" class="w-100" nolabel="1"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- ===== TOP PANELS ROW 2 ===== -->
                    <div class="row g-3">
                        <div class="col-12 col-lg-6">
                            <div class="card" style="border-radius: 14px; overflow: hidden;">
                                <div class="card-header fw-bold text-white py-2" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
                                    <field name="panel3_title" nolabel="1"/>
                                </div>
                                <div class="card-body p-0" style="max-height: 400px; overflow-y: auto;">
                                    <field name="panel3_html" class="w-100" nolabel="1"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-12 col-lg-6">
                            <div class="card" style="border-radius: 14px; overflow: hidden;">
                                <div class="card-header fw-bold text-white py-2" style="background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);">
                                    <field name="panel4_title" nolabel="1"/>
                                </div>
                                <div class="card-body p-0" style="max-height: 400px; overflow-y: auto;">
                                    <field name="panel4_html" class="w-100" nolabel="1"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Dashboard Action -->
    <record id="action_fusion_claims_dashboard" model="ir.actions.act_window">
        <field name="name">Dashboard</field>
        <field name="res_model">fusion.claims.dashboard</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_fusion_claims_dashboard_form"/>
        <field name="target">current</field>
    </record>
</odoo>
