<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/brand_window_bg"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="16dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:orientation="horizontal">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical"
                android:paddingEnd="12dp">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Client dashboard"
                    android:textColor="@color/brand_text_dark"
                    android:textSize="26sp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/dashboardSubtitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="2dp"
                    android:textColor="@color/brand_text_muted"
                    android:textSize="14sp" />
            </LinearLayout>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/dashboardBackButton"
                android:layout_width="wrap_content"
                android:layout_height="@dimen/pill_height"
                android:text="Back"
                android:textAllCaps="false"
                android:textColor="@color/brand_purple"
                app:backgroundTint="@color/brand_header_surface"
                app:cornerRadius="@dimen/pill_radius"
                app:strokeColor="@color/brand_purple"
                app:strokeWidth="1dp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:baselineAligned="false"
            android:orientation="horizontal">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="72dp"
                android:layout_marginEnd="6dp"
                android:layout_weight="1"
                android:background="@drawable/bg_session_metric"
                android:gravity="center_vertical"
                android:orientation="vertical"
                android:paddingStart="14dp"
                android:paddingEnd="10dp">

                <TextView
                    android:id="@+id/dashboardDueValue"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColor="@color/brand_text_dark"
                    android:textSize="24sp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Due"
                    android:textColor="@color/brand_text_muted"
                    android:textSize="11sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="72dp"
                android:layout_marginStart="6dp"
                android:layout_marginEnd="6dp"
                android:layout_weight="1"
                android:background="@drawable/bg_session_metric"
                android:gravity="center_vertical"
                android:orientation="vertical"
                android:paddingStart="14dp"
                android:paddingEnd="10dp">

                <TextView
                    android:id="@+id/dashboardActiveValue"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColor="@color/brand_text_dark"
                    android:textSize="24sp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Active"
                    android:textColor="@color/brand_text_muted"
                    android:textSize="11sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="72dp"
                android:layout_marginStart="6dp"
                android:layout_weight="1"
                android:background="@drawable/bg_session_metric"
                android:gravity="center_vertical"
                android:orientation="vertical"
                android:paddingStart="14dp"
                android:paddingEnd="10dp">

                <TextView
                    android:id="@+id/dashboardSyncValue"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColor="@color/brand_text_dark"
                    android:textSize="24sp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Sync flags"
                    android:textColor="@color/brand_text_muted"
                    android:textSize="11sp" />
            </LinearLayout>
        </LinearLayout>

        <HorizontalScrollView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:scrollbars="none">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <com.google.android.material.button.MaterialButton
                    android:layout_width="wrap_content"
                    android:layout_height="40dp"
                    android:text="All clients"
                    android:textAllCaps="false"
                    android:textColor="@color/brand_text_on_dark"
                    app:backgroundTint="@color/brand_purple"
                    app:cornerRadius="18dp" />

                <com.google.android.material.button.MaterialButton
                    android:layout_width="wrap_content"
                    android:layout_height="40dp"
                    android:layout_marginStart="8dp"
                    android:text="Due"
                    android:textAllCaps="false"
                    android:textColor="@color/brand_text_dark"
                    app:backgroundTint="@color/brand_header_surface"
                    app:cornerRadius="18dp"
                    app:strokeColor="@color/brand_header_stroke"
                    app:strokeWidth="1dp" />

                <com.google.android.material.button.MaterialButton
                    android:layout_width="wrap_content"
                    android:layout_height="40dp"
                    android:layout_marginStart="8dp"
                    android:text="Overdue"
                    android:textAllCaps="false"
                    android:textColor="@color/brand_text_dark"
                    app:backgroundTint="@color/brand_header_surface"
                    app:cornerRadius="18dp"
                    app:strokeColor="@color/brand_header_stroke"
                    app:strokeWidth="1dp" />

                <com.google.android.material.button.MaterialButton
                    android:layout_width="wrap_content"
                    android:layout_height="40dp"
                    android:layout_marginStart="8dp"
                    android:text="Inactive"
                    android:textAllCaps="false"
                    android:textColor="@color/brand_text_dark"
                    app:backgroundTint="@color/brand_header_surface"
                    app:cornerRadius="18dp"
                    app:strokeColor="@color/brand_header_stroke"
                    app:strokeWidth="1dp" />

                <com.google.android.material.button.MaterialButton
                    android:layout_width="wrap_content"
                    android:layout_height="40dp"
                    android:layout_marginStart="8dp"
                    android:text="Sync flags"
                    android:textAllCaps="false"
                    android:textColor="@color/brand_text_dark"
                    app:backgroundTint="@color/brand_header_surface"
                    app:cornerRadius="18dp"
                    app:strokeColor="@color/brand_header_stroke"
                    app:strokeWidth="1dp" />
            </LinearLayout>
        </HorizontalScrollView>

        <EditText
            android:id="@+id/dashboardSearchInput"
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_marginTop="16dp"
            android:background="@drawable/bg_control_chip"
            android:hint="Search clients"
            android:inputType="text"
            android:maxLines="1"
            android:paddingStart="16dp"
            android:paddingEnd="16dp"
            android:textColor="@color/brand_text_dark"
            android:textColorHint="@color/brand_text_muted"
            android:textSize="15sp" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="22dp"
            android:text="Clients"
            android:textColor="@color/brand_text_dark"
            android:textSize="20sp"
            android:textStyle="bold" />

        <LinearLayout
            android:id="@+id/dashboardClientList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" />
    </LinearLayout>
</androidx.core.widget.NestedScrollView>
