Templates

Admin dashboard

A responsive SaaS operations console built from NgNova UI components, with practical navigation, metrics, data visualization, filters, and order-management workflows.

Live preview

Responsive, interactive, and composed from published NgNova components.

Skip to dashboard content
NORTHSTAR
Workspace/ Overview

Overview

Good morning, Maya. Here is what is happening across your workspace today.

Your Q3 revenue target is 84% complete

You are $38,400 away from the quarterly goal with 18 days remaining.

84%
+12.8%

Net revenue

$253.4k

$28.6k collected this week

+8.2%

Active customers

12,842

946 joined this month

+5.4%

Orders

3,486

128 awaiting fulfillment

-0.3%

Conversion

4.82%

0.3 points below target

Revenue overview

$253,400

+12.8% vs. previous period
Current period Previous period

Operations pulse

Team capacity

Healthy
Fulfillment 72%
23 / 32
Support 58%
14 / 24
Finance 61%
11 / 18
Engineering 78%
36 / 46

Recent activity

  1. New enterprise customer

    Acme Corp. signed annual plan

    10m ago
  2. Revenue milestone

    Daily revenue exceeded $50k

    1h ago
  3. High order volume

    312 orders received today

    2h ago
  4. Conversion dip

    0.3 points below target

    3h ago

Recent orders

Latest transactions requiring operational visibility

ORD-2026-0724-1287

Processing

Acme Corp.

Jul 24, 2026 09:41

$12,480.00

ORD-2026-0724-1286

Shipped

Northwind Traders

Jul 24, 2026 09:12

$6,320.00

ORD-2026-0724-1285

Processing

Stark Industries

Jul 24, 2026 08:47

$9,870.00

ORD-2026-0724-1284

Pending

Wayne Enterprises

Jul 24, 2026 08:15

$3,210.00

ORD-2026-0723-1279

Delivered

Globex Corporation

Jul 23, 2026 17:32

$15,760.00

Complete source

Copy individual files or download the project-ready package

The source below is generated from the live preview. The ZIP also includes the canvas chart helper and setup instructions, so no dashboard code is omitted.

Angular template admin-dashboard.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
<ng-template #adminNavigation let-compact="compact">
  <div class="flex min-h-0 flex-1 flex-col">
    <nav class="min-h-0 flex-1 overflow-y-auto py-0.5" aria-label="Admin workspace">
      <div class="grid gap-0.5">
        @for (item of navigationItems; track item.label) {
          <button
            type="button"
            class="group flex min-h-9 w-full items-center gap-2 rounded-md px-2.5 text-left text-xs font-medium outline-none transition-colors focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-slate-950"
            [class.justify-center]="compact"
            [class.bg-blue-50]="activeNavigation() === item.label"
            [class.text-blue-700]="activeNavigation() === item.label"
            [class.dark:bg-blue-950]="activeNavigation() === item.label"
            [class.dark:text-blue-200]="activeNavigation() === item.label"
            [class.shadow-[inset_2px_0_0_#2563eb]]="activeNavigation() === item.label"
            [class.text-slate-600]="activeNavigation() !== item.label"
            [class.dark:text-slate-300]="activeNavigation() !== item.label"
            [class.hover:bg-slate-100]="activeNavigation() !== item.label"
            [class.hover:text-slate-950]="activeNavigation() !== item.label"
            [class.dark:hover:bg-slate-900]="activeNavigation() !== item.label"
            [class.dark:hover:text-white]="activeNavigation() !== item.label"
            [attr.aria-label]="compact ? item.label : null"
            [uiTooltip]="item.label"
            tooltipPosition="right"
            [tooltipDisabled]="!compact"
            (click)="selectNavigation(item.label)"
          >
            <ng-icon [name]="item.icon" class="size-4 shrink-0" aria-hidden="true" />
            @if (!compact) {
              <span class="min-w-0 flex-1 truncate">{{ item.label }}</span>
            }
            @if (item.badge && !compact) {
              <span
                class="rounded-full bg-blue-50 px-1.5 py-0.5 text-xs font-semibold text-blue-700"
              >
                {{ item.badge }}
              </span>
            }
          </button>
        }
      </div>
    </nav>

    <div class="shrink-0 border-t border-slate-200 pt-3 dark:border-slate-800">
      <button
        type="button"
        class="flex w-full items-center gap-2.5 rounded-md p-2 text-left outline-none transition-colors hover:bg-slate-100 focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:hover:bg-slate-900 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-slate-950"
        [class.justify-center]="compact"
        [attr.aria-label]="compact ? 'Account settings for Maya Chen' : null"
        uiTooltip="Account settings"
        tooltipPosition="right"
        [tooltipDisabled]="!compact"
      >
        <ui-avatar label="Maya Chen" size="sm" />
        @if (!compact) {
          <span class="min-w-0 flex-1">
            <span class="block truncate text-xs font-semibold text-slate-900">Maya Chen</span>
            <span class="block truncate text-xs text-slate-500 dark:text-slate-400"
              >Administrator</span
            >
          </span>
          <ng-icon name="heroChevronDown" class="size-3.5 text-slate-400" aria-hidden="true" />
        }
      </button>
    </div>
  </div>
</ng-template>

<ng-template #customerWorkspace>
  <ui-card padding="none" ariaLabel="Customer management">
    <div
      class="grid gap-3 border-b border-slate-200 p-4 dark:border-slate-800 md:grid-cols-[minmax(15rem,1fr)_11rem_auto] md:items-center"
    >
      <ui-input
        ariaLabel="Search customers"
        placeholder="Search name, company, or email..."
        size="sm"
        clearable
        (valueChange)="customerSearch.set($event)"
      >
        <ng-icon inputPrefix name="heroMagnifyingGlass" class="size-4" aria-hidden="true" />
      </ui-input>
      <label>
        <span class="sr-only">Filter customers by status</span>
        <select
          class="h-8 w-full rounded-md border border-slate-300 bg-white px-2.5 text-xs text-slate-700 shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-200"
          [value]="customerStatusFilter()"
          (change)="updateCustomerStatusFilter($event)"
        >
          <option value="All">All statuses</option>
          <option value="Active">Active</option>
          <option value="Trial">Trial</option>
          <option value="At risk">At risk</option>
        </select>
      </label>
      <p class="text-xs font-medium text-slate-500 md:text-right dark:text-slate-400">
        {{ filteredCustomers().length }} customers
      </p>
    </div>

    @if (filteredCustomers().length > 0) {
      <div class="divide-y divide-slate-200 md:hidden dark:divide-slate-800">
        @for (customer of filteredCustomers(); track customer.id) {
          <button
            type="button"
            class="flex w-full items-center gap-3 p-4 text-left transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500 dark:hover:bg-slate-900"
            (click)="openCustomerEditor(customer)"
          >
            <ui-avatar [label]="customer.name" size="sm" />
            <span class="min-w-0 flex-1">
              <span class="block truncate text-sm font-semibold text-slate-900 dark:text-white">
                {{ customer.name }}
              </span>
              <span class="mt-0.5 block truncate text-xs text-slate-500 dark:text-slate-400">
                {{ customer.company }} · {{ customer.plan }}
              </span>
            </span>
            <ui-tag size="sm" [variant]="customerStatusVariant(customer.status)">
              {{ customer.status }}
            </ui-tag>
          </button>
        }
      </div>

      <div class="hidden overflow-x-auto md:block">
        <table class="w-full border-collapse text-left text-xs">
          <caption class="sr-only">
            Customers matching the current filters
          </caption>
          <thead class="bg-slate-50 text-slate-500 dark:bg-slate-900/70 dark:text-slate-400">
            <tr>
              <th class="px-4 py-3 font-semibold">Customer</th>
              <th class="px-4 py-3 font-semibold">Company</th>
              <th class="px-4 py-3 font-semibold">Plan</th>
              <th class="px-4 py-3 font-semibold">Status</th>
              <th class="px-4 py-3 font-semibold">Joined</th>
              <th class="px-4 py-3 text-right font-semibold">Action</th>
            </tr>
          </thead>
          <tbody class="divide-y divide-slate-200 dark:divide-slate-800">
            @for (customer of filteredCustomers(); track customer.id) {
              <tr class="hover:bg-slate-50/80 dark:hover:bg-slate-900/50">
                <td class="px-4 py-3">
                  <div class="flex items-center gap-2.5">
                    <ui-avatar [label]="customer.name" size="sm" />
                    <div class="min-w-0">
                      <p class="font-semibold text-slate-900 dark:text-slate-100">
                        {{ customer.name }}
                      </p>
                      <p class="mt-0.5 text-slate-500 dark:text-slate-400">
                        {{ customer.email }}
                      </p>
                    </div>
                  </div>
                </td>
                <td class="px-4 py-3 text-slate-700 dark:text-slate-300">
                  {{ customer.company }}
                </td>
                <td class="px-4 py-3 text-slate-700 dark:text-slate-300">
                  {{ customer.plan }}
                </td>
                <td class="px-4 py-3">
                  <ui-tag size="sm" [variant]="customerStatusVariant(customer.status)">
                    {{ customer.status }}
                  </ui-tag>
                </td>
                <td class="whitespace-nowrap px-4 py-3 text-slate-500 dark:text-slate-400">
                  {{ customer.joined }}
                </td>
                <td class="px-4 py-3 text-right">
                  <button
                    type="button"
                    uiButton
                    variant="ghost"
                    size="sm"
                    (click)="openCustomerEditor(customer)"
                  >
                    View
                  </button>
                </td>
              </tr>
            }
          </tbody>
        </table>
      </div>
    } @else {
      <div class="px-4 py-12 text-center">
        <p class="text-sm font-semibold text-slate-900 dark:text-white">No customers found</p>
        <p class="mt-1 text-xs text-slate-500 dark:text-slate-400">
          Try a different search or status filter.
        </p>
      </div>
    }
  </ui-card>
</ng-template>

<ng-template #ordersWorkspace>
  <ui-card padding="none" ariaLabel="Order management">
    <div
      class="grid gap-3 border-b border-slate-200 p-4 dark:border-slate-800 md:grid-cols-[minmax(15rem,1fr)_11rem_auto] md:items-center"
    >
      <ui-input
        ariaLabel="Search orders"
        placeholder="Search order or customer..."
        size="sm"
        clearable
        (valueChange)="orderSearch.set($event)"
      >
        <ng-icon inputPrefix name="heroMagnifyingGlass" class="size-4" aria-hidden="true" />
      </ui-input>
      <label>
        <span class="sr-only">Filter orders by status</span>
        <select
          class="h-8 w-full rounded-md border border-slate-300 bg-white px-2.5 text-xs text-slate-700 shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-200"
          [value]="orderStatusFilter()"
          (change)="updateOrderStatusFilter($event)"
        >
          <option value="All">All statuses</option>
          <option value="Processing">Processing</option>
          <option value="Shipped">Shipped</option>
          <option value="Pending">Pending</option>
          <option value="Delivered">Delivered</option>
        </select>
      </label>
      <p class="text-xs font-medium text-slate-500 md:text-right dark:text-slate-400">
        {{ filteredOrderRows().length }} orders
      </p>
    </div>

    @if (selectedOrderKeys().length > 0) {
      <div
        class="flex flex-wrap items-center justify-between gap-3 border-b border-blue-200 bg-blue-50 px-4 py-2.5 dark:border-blue-900 dark:bg-blue-950/40"
      >
        <p class="text-xs font-semibold text-blue-800 dark:text-blue-200">
          {{ selectedOrderKeys().length }} selected
        </p>
        <div class="flex gap-2">
          <button type="button" uiButton variant="outline" size="sm" (click)="markOrdersShipped()">
            Mark shipped
          </button>
          <button
            type="button"
            uiButton
            variant="ghost"
            size="sm"
            (click)="selectedOrderKeys.set([])"
          >
            Clear
          </button>
        </div>
      </div>
    }

    <div class="divide-y divide-slate-200 sm:hidden dark:divide-slate-800">
      @for (row of filteredOrderRows(); track row['id']) {
        <article class="grid grid-cols-[minmax(0,1fr)_auto] gap-3 p-4">
          <div class="min-w-0">
            <div class="flex flex-wrap items-center gap-2">
              <h3 class="truncate text-xs font-semibold text-slate-900 dark:text-slate-100">
                {{ text(row['id']) }}
              </h3>
              <ui-tag size="sm" [variant]="orderStatusVariant(row['status'])">
                {{ text(row['status']) }}
              </ui-tag>
            </div>
            <p class="mt-1.5 truncate text-sm font-medium text-slate-800 dark:text-slate-100">
              {{ text(row['customer']) }}
            </p>
            <p class="mt-1 text-xs text-slate-500 dark:text-slate-400">
              {{ text(row['date']) }}
            </p>
          </div>
          <p class="whitespace-nowrap text-sm font-semibold text-slate-950 dark:text-white">
            {{ text(row['total']) }}
          </p>
        </article>
      }
    </div>

    <ui-table
      class="hidden sm:block [&_table]:!text-xs [&_td]:!px-3 [&_td]:!py-2.5 [&_th]:!px-3 [&_th]:!py-2.5"
      caption="Filtered customer orders"
      [columns]="orderColumns"
      [rows]="filteredOrderRows()"
      rowKey="id"
      selectionMode="multiple"
      [selectedKeys]="selectedOrderKeys()"
      (selectedKeysChange)="selectedOrderKeys.set($event)"
    >
      <ng-template uiTableCell="id" let-value>
        <span class="whitespace-nowrap font-medium text-slate-700 dark:text-slate-200">{{
          text(value)
        }}</span>
      </ng-template>
      <ng-template uiTableCell="customer" let-value>
        <span class="font-medium text-slate-800 dark:text-slate-100">{{ text(value) }}</span>
      </ng-template>
      <ng-template uiTableCell="status" let-value>
        <ui-tag size="sm" [variant]="orderStatusVariant(value)">{{ text(value) }}</ui-tag>
      </ng-template>
      <ng-template uiTableCell="total" let-value>
        <span class="font-semibold text-slate-900 dark:text-slate-100">{{ text(value) }}</span>
      </ng-template>
      <ng-template uiTableCell="date" let-value>
        <span class="whitespace-nowrap text-slate-600 dark:text-slate-300">{{ text(value) }}</span>
      </ng-template>
      <ng-template uiTableCell="actions" let-row="row">
        <button
          type="button"
          uiButton
          variant="ghost"
          size="sm"
          [attr.aria-label]="'Order actions for ' + text(row['id'])"
        >
          <ng-icon name="heroEllipsisVertical" class="size-4" aria-hidden="true" />
        </button>
      </ng-template>
    </ui-table>
  </ui-card>
</ng-template>

<ng-template #moduleWorkspace>
  <section class="grid gap-3 md:grid-cols-3" [attr.aria-label]="activeNavigation() + ' summary'">
    @for (insight of activeModuleInsights(); track insight.label) {
      <ui-card padding="md" [ariaLabel]="insight.label">
        <p class="text-xs font-medium text-slate-500 dark:text-slate-400">
          {{ insight.label }}
        </p>
        <p class="mt-2 text-2xl font-bold tracking-tight text-slate-950 dark:text-white">
          {{ insight.value }}
        </p>
        <p class="mt-2 text-xs leading-5 text-slate-500 dark:text-slate-400">
          {{ insight.detail }}
        </p>
      </ui-card>
    }
  </section>
  <ui-card class="mt-4" padding="md" [ariaLabel]="activeNavigation() + ' activity'">
    <h2 class="text-sm font-semibold text-slate-950 dark:text-white">
      Recent {{ activeNavigation().toLowerCase() }} activity
    </h2>
    <p class="mt-2 max-w-2xl text-sm leading-6 text-slate-600 dark:text-slate-300">
      This workspace is ready for product-specific data. The template keeps navigation, responsive
      layout, theming, and interaction patterns consistent while your application supplies its own
      API.
    </p>
  </ui-card>
</ng-template>

<div
  class="relative h-screen min-h-screen h-dvh min-h-dvh overflow-hidden bg-slate-50/70 text-slate-950 dark:bg-slate-950 dark:text-slate-50 motion-reduce:transition-none xl:grid xl:grid-rows-[minmax(0,1fr)] xl:transition-[grid-template-columns] xl:duration-200"
  [class.dark]="darkMode()"
  [style.grid-template-columns]="
    sidebarCollapsed() ? '4rem minmax(0, 1fr)' : '14.5rem minmax(0, 1fr)'
  "
  data-admin-template
>
  <a
    href="#admin-main-content"
    class="absolute left-3 top-3 z-50 -translate-y-20 rounded-md bg-white px-3 py-2 text-sm font-semibold text-blue-700 shadow-lg ring-2 ring-blue-500 transition-transform focus-visible:translate-y-0 dark:bg-slate-900 dark:text-blue-300"
  >
    Skip to dashboard content
  </a>

  <aside
    class="hidden h-full min-h-0 overflow-hidden border-r border-slate-200/80 bg-white text-slate-950 dark:border-slate-800 dark:bg-slate-950 dark:text-white xl:flex xl:flex-col"
    [class.p-2]="sidebarCollapsed()"
    [class.p-3]="!sidebarCollapsed()"
    data-admin-desktop-navigation
  >
    <div
      class="flex items-center border-b border-slate-100 pb-3 dark:border-slate-800"
      [class.justify-center]="sidebarCollapsed()"
      [class.gap-2.5]="!sidebarCollapsed()"
      [class.px-1]="!sidebarCollapsed()"
    >
      @if (!sidebarCollapsed()) {
        <span
          class="inline-flex size-8 shrink-0 items-center justify-center rounded-lg bg-blue-600 text-white shadow-sm shadow-blue-600/20"
          data-admin-brand-mark
        >
          <ng-icon name="heroBolt" class="size-4.5" aria-hidden="true" />
        </span>
        <span class="min-w-0 flex-1">
          <span class="block truncate text-xs font-bold tracking-wide">NORTHSTAR</span>
          <span class="block truncate text-xs text-slate-500 dark:text-slate-400"
            >Operations cloud</span
          >
        </span>
      }
      <button
        type="button"
        class="inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-slate-200 bg-slate-50 text-slate-500 shadow-sm transition-colors hover:border-blue-200 hover:bg-blue-50 hover:text-blue-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-400 dark:hover:border-blue-800 dark:hover:bg-blue-950/60 dark:hover:text-blue-300 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-slate-950"
        [attr.aria-label]="sidebarCollapsed() ? 'Expand admin sidebar' : 'Collapse admin sidebar'"
        [attr.aria-pressed]="sidebarCollapsed()"
        (click)="toggleSidebar()"
      >
        <ng-icon
          [name]="sidebarCollapsed() ? 'heroChevronRight' : 'heroChevronLeft'"
          class="size-4"
          aria-hidden="true"
        />
      </button>
    </div>

    <div class="mt-3.5" [class.hidden]="sidebarCollapsed()">
      <ui-input ariaLabel="Search workspace" placeholder="Search..." size="sm">
        <ng-icon inputPrefix name="heroMagnifyingGlass" class="size-4" aria-hidden="true" />
      </ui-input>
    </div>

    <p
      class="mb-1.5 mt-4 px-2.5 text-xs font-bold uppercase tracking-[0.12em] text-slate-400"
      [class.sr-only]="sidebarCollapsed()"
    >
      Workspace
    </p>
    <ng-container
      [ngTemplateOutlet]="adminNavigation"
      [ngTemplateOutletContext]="{ compact: sidebarCollapsed() }"
    />
  </aside>

  <ui-drawer
    class="contents xl:hidden"
    position="left"
    size="sm"
    [open]="mobileNavigationOpen()"
    ariaLabel="Admin navigation"
    closeAriaLabel="Close admin navigation"
    drawerId="admin-mobile-navigation"
    (openChange)="mobileNavigationOpen.set($event)"
  >
    <span uiDrawerHeader>Northstar workspace</span>
    <div
      class="-m-4 flex min-h-full flex-col bg-white p-4 text-slate-950 dark:bg-slate-950 dark:text-slate-50"
    >
      <ng-container
        [ngTemplateOutlet]="adminNavigation"
        [ngTemplateOutletContext]="{ compact: false }"
      />
    </div>
  </ui-drawer>

  <main
    id="admin-main-content"
    class="h-full min-h-0 min-w-0 overflow-y-auto bg-slate-50/70 dark:bg-slate-950"
    aria-labelledby="admin-title"
    tabindex="-1"
  >
    <header
      class="sticky top-0 z-30 border-b border-slate-200/80 bg-white/95 backdrop-blur dark:border-slate-800 dark:bg-slate-950/95"
      data-admin-header
    >
      <div
        class="mx-auto flex min-h-14 w-full max-w-[100rem] items-center gap-2.5 px-3 sm:px-4 lg:px-5"
      >
        <button
          type="button"
          uiButton
          variant="ghost"
          size="sm"
          class="xl:hidden"
          aria-label="Open admin navigation"
          aria-controls="admin-mobile-navigation"
          [attr.aria-expanded]="mobileNavigationOpen()"
          (click)="mobileNavigationOpen.set(true)"
        >
          <ng-icon name="heroBars3" class="size-5" aria-hidden="true" />
        </button>

        <div class="flex min-w-0 items-center gap-2.5 xl:hidden">
          <span
            class="hidden size-8 shrink-0 items-center justify-center rounded-lg bg-blue-600 text-white shadow-sm shadow-blue-600/20 sm:inline-flex"
          >
            <ng-icon name="heroBolt" class="size-4.5" aria-hidden="true" />
          </span>
          <span class="min-w-0">
            <span class="block truncate text-xs font-bold tracking-wide">NORTHSTAR</span>
            <span class="hidden truncate text-xs text-slate-500 sm:block dark:text-slate-400"
              >Operations cloud</span
            >
          </span>
        </div>

        <div class="hidden w-full max-w-lg md:block">
          <ui-input
            data-admin-header-search
            ariaLabel="Search customers, orders, and reports"
            placeholder="Search customers, orders, and reports..."
            size="sm"
            (valueChange)="handleGlobalSearch($event)"
          >
            <ng-icon
              inputPrefix
              name="heroMagnifyingGlass"
              class="size-4 text-slate-400"
              aria-hidden="true"
            />
          </ui-input>
        </div>

        <div class="ml-auto flex shrink-0 items-center gap-1 sm:gap-1.5">
          <div
            class="mr-1 hidden items-center gap-2 text-xs text-slate-500 lg:flex dark:text-slate-400"
          >
            <span class="size-1.5 rounded-full bg-emerald-500" aria-hidden="true"></span>
            <span>Live</span>
            <span class="hidden 2xl:inline">· Friday, July 24</span>
          </div>

          <span class="hidden h-6 w-px bg-slate-200 lg:block dark:bg-slate-800"></span>

          <ui-button
            iconOnly
            variant="ghost"
            size="sm"
            [ariaLabel]="darkMode() ? 'Use light dashboard theme' : 'Use dark dashboard theme'"
            [title]="darkMode() ? 'Use light theme' : 'Use dark theme'"
            [attr.aria-pressed]="darkMode()"
            (click)="toggleDarkMode()"
          >
            <ng-icon uiButtonIconStart [name]="darkMode() ? 'heroSun' : 'heroMoon'" />
          </ui-button>

          <ui-button
            class="relative"
            data-admin-notifications
            iconOnly
            ariaLabel="View notifications, 3 unread"
            variant="ghost"
            size="sm"
            (click)="showAction('Notifications', 'You have three unread operational updates.')"
          >
            <ng-icon uiButtonIconStart name="heroBell" />
            <span
              class="absolute right-1.5 top-1.5 size-2 rounded-full bg-red-500 ring-2 ring-white dark:ring-slate-950"
              aria-hidden="true"
            ></span>
          </ui-button>

          <ui-menu
            [items]="profileMenuItems"
            [open]="profileMenuOpen()"
            align="end"
            ariaLabel="Account actions"
            (openChange)="profileMenuOpen.set($event)"
          >
            <button
              uiMenuTrigger
              type="button"
              class="inline-flex min-h-10 items-center gap-2 rounded-lg px-1.5 text-left transition-colors hover:bg-slate-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 sm:px-2 dark:hover:bg-slate-900 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-slate-950"
              aria-label="Open account menu for Maya Chen"
            >
              <ui-avatar label="Maya Chen" size="sm" />
              <span class="hidden min-w-0 sm:block">
                <span
                  class="block max-w-24 truncate text-xs font-semibold text-slate-900 dark:text-slate-100"
                >
                  Maya Chen
                </span>
                <span class="mt-0.5 block text-xs text-slate-500 dark:text-slate-400">
                  Administrator
                </span>
              </span>
              <ng-icon name="heroChevronDown" class="size-3.5 text-slate-400" aria-hidden="true" />
            </button>
          </ui-menu>
        </div>
      </div>
    </header>

    <div class="mx-auto w-full max-w-[100rem] space-y-4 p-3 sm:p-4 lg:p-5">
      <section
        class="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between"
        data-admin-page-intro
      >
        <div class="min-w-0">
          <div class="mb-1.5 flex items-center gap-2 text-xs">
            <span class="font-medium text-slate-500 dark:text-slate-400">Workspace</span>
            <span class="text-slate-300 dark:text-slate-700">/</span>
            <span class="truncate font-medium text-slate-700 dark:text-slate-300">
              {{ activeNavigation() }}
            </span>
          </div>
          <h1
            id="admin-title"
            class="text-xl font-bold tracking-tight text-slate-950 dark:text-white"
          >
            {{ activeNavigation() }}
          </h1>
          <p class="mt-0.5 text-sm text-slate-500 dark:text-slate-400">
            {{ activePageDescription() }}
          </p>
        </div>
        <div class="flex shrink-0 items-center gap-2">
          @if (activeNavigation() === 'Overview' || activeNavigation() === 'Orders') {
            <button
              type="button"
              uiButton
              variant="outline"
              size="sm"
              class="bg-white dark:bg-slate-950"
              (click)="exportOrders()"
            >
              <ng-icon uiButtonIconStart name="heroArrowDownTray" />
              Export
            </button>
          }
          @if (activeNavigation() === 'Overview' || activeNavigation() === 'Customers') {
            <ui-button size="sm" (click)="openCustomerEditor()">
              <ng-icon uiButtonIconStart name="heroUserPlus" />
              Add customer
            </ui-button>
          }
        </div>
      </section>

      @if (activeNavigation() === 'Customers') {
        <ng-container [ngTemplateOutlet]="customerWorkspace" />
      } @else if (activeNavigation() === 'Orders') {
        <ng-container [ngTemplateOutlet]="ordersWorkspace" />
      } @else if (activeNavigation() !== 'Overview') {
        <ng-container [ngTemplateOutlet]="moduleWorkspace" />
      }

      @if (activeNavigation() === 'Overview') {
        <section
          class="grid items-center gap-3 rounded-lg border border-slate-200 bg-white px-3.5 py-2.5 shadow-sm sm:grid-cols-[minmax(0,1fr)_14rem] dark:border-slate-800 dark:bg-slate-900"
          aria-label="Quarterly revenue target"
        >
          <div class="flex min-w-0 items-center gap-2.5">
            <ng-icon
              name="heroCheckCircle"
              class="size-5 shrink-0 text-emerald-700 dark:text-emerald-300"
              aria-hidden="true"
            />
            <div class="min-w-0">
              <h2 class="text-sm font-semibold text-slate-950 dark:text-white">
                Your Q3 revenue target is 84% complete
              </h2>
              <p class="mt-0.5 text-xs text-slate-600 dark:text-slate-300">
                You are $38,400 away from the quarterly goal with 18 days remaining.
              </p>
            </div>
          </div>
          <div class="flex items-center gap-3">
            <ui-progress-bar
              class="min-w-0 flex-1"
              [value]="84"
              label="Quarterly revenue target"
              ariaValueText="84 percent complete"
            />
            <span class="w-7 text-right text-xs font-semibold text-slate-600 dark:text-slate-300">
              84%
            </span>
          </div>
        </section>

        <section class="grid grid-cols-2 gap-3 xl:grid-cols-4" aria-label="Key metrics">
          @for (metric of metrics; track metric.label) {
            <ui-card class="min-w-0" padding="none" [ariaLabel]="metric.label + ' metric'">
              <article
                data-admin-metric
                class="min-w-0 p-3.5"
                [attr.aria-label]="metric.label + ' metric'"
              >
                <div class="flex items-start justify-between gap-2 sm:gap-3">
                  <span [class]="metricIconClasses(metric.tone)">
                    <ng-icon [name]="metric.icon" class="size-4" aria-hidden="true" />
                  </span>
                  <ui-tag size="sm" [variant]="metric.positive ? 'success' : 'danger'">
                    {{ metric.change }}
                  </ui-tag>
                </div>
                <p class="mt-3 truncate text-xs font-medium text-slate-500 dark:text-slate-400">
                  {{ metric.label }}
                </p>
                <p
                  class="mt-1 text-xl font-bold leading-none tracking-tight text-slate-950 dark:text-white"
                >
                  {{ metric.value }}
                </p>
                <p class="mt-2 line-clamp-2 text-xs leading-4 text-slate-500 dark:text-slate-400">
                  {{ metric.context }}
                </p>
              </article>
            </ui-card>
          }
        </section>

        <section
          class="grid items-stretch gap-3 xl:grid-cols-[minmax(0,1.6fr)_minmax(19rem,0.8fr)]"
          aria-label="Performance and operations"
        >
          <ui-card class="h-full min-w-0" padding="none" ariaLabel="Revenue overview">
            <div
              class="flex flex-col gap-3 border-b border-slate-200 px-4 py-3 sm:flex-row sm:items-start sm:justify-between dark:border-slate-800"
            >
              <div>
                <h2 class="text-sm font-semibold text-slate-950 dark:text-white">
                  Revenue overview
                </h2>
                <div class="mt-2 flex flex-wrap items-end gap-x-3 gap-y-1">
                  <p class="text-xl font-bold tracking-tight text-slate-950 dark:text-white">
                    $253,400
                  </p>
                  <span class="text-xs font-semibold text-emerald-700 dark:text-emerald-300">
                    +12.8% vs. previous period
                  </span>
                </div>
              </div>
              <button
                type="button"
                uiButton
                variant="outline"
                size="sm"
                class="gap-1.5 text-xs"
                aria-label="Revenue date range, July 18 through July 24, 2026"
                (click)="
                  showAction('Reporting period', 'Showing revenue from July 18 through July 24.')
                "
              >
                Jul 18 – Jul 24
                <ng-icon name="heroCalendarDays" class="size-3.5" aria-hidden="true" />
              </button>
            </div>

            <div class="px-4 pb-2 pt-3">
              <app-admin-revenue-chart [darkMode]="darkMode()" />
            </div>

            <div
              class="flex flex-wrap items-center gap-x-4 gap-y-1 border-t border-slate-200 px-4 py-2.5 text-xs text-slate-500 dark:border-slate-800 dark:text-slate-400"
            >
              <span class="inline-flex items-center gap-1.5">
                <span class="size-2 rounded-full bg-blue-600"></span>
                Current period
              </span>
              <span class="inline-flex items-center gap-1.5">
                <span class="size-2 rounded-full bg-slate-300"></span>
                Previous period
              </span>
            </div>
          </ui-card>

          <ui-card class="h-full min-w-0" padding="none" ariaLabel="Operations pulse">
            <div class="flex items-center justify-between gap-3 px-4 py-3">
              <div>
                <h2 class="text-sm font-semibold text-slate-950 dark:text-white">
                  Operations pulse
                </h2>
                <p class="mt-0.5 text-xs text-slate-500 dark:text-slate-400">Team capacity</p>
              </div>
              <ui-tag size="sm" variant="success">Healthy</ui-tag>
            </div>
            <div
              class="divide-y divide-slate-200 border-t border-slate-200 dark:divide-slate-800 dark:border-slate-800"
            >
              @for (team of teamCapacity; track team.label) {
                <div
                  class="grid grid-cols-[4.5rem_2rem_minmax(3rem,1fr)_3rem] items-center gap-2.5 px-4 py-2.5"
                >
                  <span class="truncate text-xs font-medium text-slate-600 dark:text-slate-300">
                    {{ team.label }}
                  </span>
                  <span class="text-right text-xs font-semibold text-slate-700 dark:text-slate-200">
                    {{ team.value }}%
                  </span>
                  <ui-progress-bar
                    [value]="team.value"
                    [label]="team.label + ' capacity'"
                    [ariaValueText]="team.value + ' percent allocated'"
                  />
                  <span class="text-right text-xs text-slate-500 dark:text-slate-400">
                    {{ team.assigned }}
                  </span>
                </div>
              }
            </div>
          </ui-card>

          <ui-card class="h-full min-w-0 xl:col-span-2" padding="none" ariaLabel="Recent activity">
            <div class="flex items-center justify-between gap-3 px-4 py-3">
              <h2 class="text-sm font-semibold text-slate-950 dark:text-white">Recent activity</h2>
              <button
                type="button"
                class="-mr-2 inline-flex min-h-8 items-center rounded-md px-2 text-xs font-medium text-blue-700 hover:bg-blue-50 hover:text-blue-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 dark:text-blue-300 dark:hover:bg-blue-950 dark:focus-visible:ring-offset-slate-950"
                (click)="
                  showAction('Activity feed', 'You are viewing the latest workspace events.')
                "
              >
                View all
              </button>
            </div>
            <ol
              class="grid border-t border-slate-200 px-4 sm:grid-cols-2 xl:grid-cols-4 xl:divide-x dark:border-slate-800 dark:divide-slate-800"
            >
              @for (activity of activities; track activity.title + activity.time) {
                <li class="flex min-w-0 gap-2.5 py-2.5 sm:px-3 sm:first:pl-0 xl:last:pr-0">
                  <span [class]="activityIconClasses(activity.tone)">
                    <ng-icon [name]="activity.icon" class="size-4" aria-hidden="true" />
                  </span>
                  <div class="min-w-0 flex-1">
                    <p class="truncate text-xs font-medium text-slate-800 dark:text-slate-100">
                      {{ activity.title }}
                    </p>
                    <p class="mt-0.5 truncate text-xs text-slate-500 dark:text-slate-400">
                      {{ activity.detail }}
                    </p>
                  </div>
                  <span class="shrink-0 text-xs text-slate-400">{{ activity.time }}</span>
                </li>
              }
            </ol>
          </ui-card>
        </section>

        <ui-card padding="none" ariaLabel="Recent orders">
          <div
            class="flex items-center justify-between gap-3 border-b border-slate-200 px-4 py-3 dark:border-slate-800"
          >
            <div>
              <h2 class="text-sm font-semibold text-slate-950 dark:text-white">Recent orders</h2>
              <p class="mt-0.5 text-xs text-slate-500 dark:text-slate-400">
                Latest transactions requiring operational visibility
              </p>
            </div>
            <button
              type="button"
              class="-mr-2 inline-flex min-h-8 items-center rounded-md px-2 text-xs font-medium text-blue-700 hover:bg-blue-50 hover:text-blue-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 dark:text-blue-300 dark:hover:bg-blue-950 dark:focus-visible:ring-offset-slate-950"
              (click)="selectNavigation('Orders')"
            >
              View all orders
            </button>
          </div>

          <div
            class="divide-y divide-slate-200 sm:hidden dark:divide-slate-800"
            data-admin-mobile-orders
          >
            @for (row of orderRows(); track row['id']) {
              <article class="grid grid-cols-[minmax(0,1fr)_auto] gap-3 p-4">
                <div class="min-w-0">
                  <div class="flex flex-wrap items-center gap-2">
                    <h3 class="truncate text-xs font-semibold text-slate-900 dark:text-slate-100">
                      {{ text(row['id']) }}
                    </h3>
                    <ui-tag size="sm" [variant]="orderStatusVariant(row['status'])">
                      {{ text(row['status']) }}
                    </ui-tag>
                  </div>
                  <p class="mt-1.5 truncate text-sm font-medium text-slate-800 dark:text-slate-100">
                    {{ text(row['customer']) }}
                  </p>
                  <p class="mt-1 text-xs text-slate-500 dark:text-slate-400">
                    {{ text(row['date']) }}
                  </p>
                </div>
                <div class="flex flex-col items-end justify-between gap-3">
                  <button
                    type="button"
                    uiButton
                    variant="ghost"
                    size="sm"
                    [attr.aria-label]="'Order actions for ' + text(row['id'])"
                    (click)="showOrderActions(row)"
                  >
                    <ng-icon name="heroEllipsisVertical" class="size-4" aria-hidden="true" />
                  </button>
                  <p class="whitespace-nowrap text-sm font-semibold text-slate-950 dark:text-white">
                    {{ text(row['total']) }}
                  </p>
                </div>
              </article>
            }
          </div>

          <ui-table
            class="hidden sm:block [&_table]:!text-xs [&_td]:!px-3 [&_td]:!py-2 [&_th]:!px-3 [&_th]:!py-2"
            caption="Recent customer orders"
            [columns]="orderColumns"
            [rows]="orderRows()"
            rowKey="id"
            selectionMode="multiple"
            [selectedKeys]="selectedOrderKeys()"
            (selectedKeysChange)="selectedOrderKeys.set($event)"
          >
            <ng-template uiTableCell="id" let-value>
              <span class="whitespace-nowrap font-medium text-slate-700 dark:text-slate-200">{{
                text(value)
              }}</span>
            </ng-template>

            <ng-template uiTableCell="customer" let-value>
              <span class="font-medium text-slate-800 dark:text-slate-100">
                {{ text(value) }}
              </span>
            </ng-template>

            <ng-template uiTableCell="status" let-value>
              <ui-tag size="sm" [variant]="orderStatusVariant(value)">
                {{ text(value) }}
              </ui-tag>
            </ng-template>

            <ng-template uiTableCell="total" let-value>
              <span class="font-semibold text-slate-900 dark:text-slate-100">
                {{ text(value) }}
              </span>
            </ng-template>

            <ng-template uiTableCell="date" let-value>
              <span class="whitespace-nowrap text-slate-600 dark:text-slate-300">
                {{ text(value) }}
              </span>
            </ng-template>

            <ng-template uiTableCell="actions" let-row="row">
              <button
                type="button"
                uiButton
                variant="ghost"
                size="sm"
                [attr.aria-label]="'Order actions for ' + text(row['id'])"
                (click)="showOrderActions(row)"
              >
                <ng-icon name="heroEllipsisVertical" class="size-4" aria-hidden="true" />
              </button>
            </ng-template>
          </ui-table>
        </ui-card>
      }
    </div>
  </main>

  <ui-drawer
    position="right"
    size="md"
    [open]="customerDrawerOpen()"
    [ariaLabel]="selectedCustomer() ? 'Edit customer' : 'Add customer'"
    closeAriaLabel="Close customer editor"
    drawerId="admin-customer-editor"
    (openChange)="customerDrawerOpen.set($event)"
  >
    <span uiDrawerHeader>{{ selectedCustomer() ? 'Customer details' : 'Add customer' }}</span>
    <form class="grid gap-5" (submit)="saveCustomer($event)">
      <div>
        <p class="text-sm font-semibold text-slate-950 dark:text-white">
          {{ selectedCustomer() ? 'Update customer record' : 'Create a customer record' }}
        </p>
        <p class="mt-1 text-xs leading-5 text-slate-500 dark:text-slate-400">
          This local workflow demonstrates a production form without requiring a backend.
        </p>
      </div>

      <label class="grid gap-1.5 text-sm font-medium text-slate-800 dark:text-slate-100">
        Full name
        <input
          name="customerName"
          required
          autocomplete="name"
          class="h-10 rounded-md border border-slate-300 bg-white px-3 text-sm font-normal shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:border-slate-700 dark:bg-slate-950"
          [value]="customerFormName()"
          (input)="customerFormName.set(inputValue($event))"
        />
      </label>
      <label class="grid gap-1.5 text-sm font-medium text-slate-800 dark:text-slate-100">
        Work email
        <input
          name="customerEmail"
          type="email"
          required
          autocomplete="email"
          class="h-10 rounded-md border border-slate-300 bg-white px-3 text-sm font-normal shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:border-slate-700 dark:bg-slate-950"
          [value]="customerFormEmail()"
          (input)="customerFormEmail.set(inputValue($event))"
        />
      </label>
      <label class="grid gap-1.5 text-sm font-medium text-slate-800 dark:text-slate-100">
        Company
        <input
          name="customerCompany"
          required
          autocomplete="organization"
          class="h-10 rounded-md border border-slate-300 bg-white px-3 text-sm font-normal shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:border-slate-700 dark:bg-slate-950"
          [value]="customerFormCompany()"
          (input)="customerFormCompany.set(inputValue($event))"
        />
      </label>
      <div class="grid gap-4 sm:grid-cols-2">
        <label class="grid gap-1.5 text-sm font-medium text-slate-800 dark:text-slate-100">
          Plan
          <select
            name="customerPlan"
            class="h-10 rounded-md border border-slate-300 bg-white px-3 text-sm font-normal shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:border-slate-700 dark:bg-slate-950"
            [value]="customerFormPlan()"
            (change)="updateCustomerFormPlan($event)"
          >
            <option value="Enterprise">Enterprise</option>
            <option value="Growth">Growth</option>
            <option value="Starter">Starter</option>
          </select>
        </label>
        <label class="grid gap-1.5 text-sm font-medium text-slate-800 dark:text-slate-100">
          Status
          <select
            name="customerStatus"
            class="h-10 rounded-md border border-slate-300 bg-white px-3 text-sm font-normal shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:border-slate-700 dark:bg-slate-950"
            [value]="customerFormStatus()"
            (change)="updateCustomerFormStatus($event)"
          >
            <option value="Active">Active</option>
            <option value="Trial">Trial</option>
            <option value="At risk">At risk</option>
          </select>
        </label>
      </div>

      <div class="mt-2 flex justify-end gap-2 border-t border-slate-200 pt-4 dark:border-slate-800">
        <button type="button" uiButton variant="outline" (click)="customerDrawerOpen.set(false)">
          Cancel
        </button>
        <ui-button type="submit">Save customer</ui-button>
      </div>
    </form>
  </ui-drawer>

  <ui-toast position="bottom-right" viewportOffset="1rem" />
</div>