File size: 73,866 Bytes
d2ac159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
import { useState, useEffect, useRef } from "react";

/* ============================================================

   TICKETPUNCH UI β€” Complete Cyberpunk Design System

   Font: IBM Plex Mono | Palette: Dark / White / Gold / Red / Peach

   ============================================================ */

const FontInjector = () => (
  <style>{`

    @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {

      /* ── DARK ── */

      --d-900: #060606;

      --d-800: #0A0A0A;

      --d-700: #0f0f0f;

      --d-600: #1e1e1e;

      --d-500: #2a2a2a;



      /* ── WHITE ── */

      --w-100: #FFFFFF;

      --w-200: #EFEFEF;

      --w-300: #CDCDCD;

      --w-400: #AAAAAA;

      --w-500: #888888;



      /* ── GOLD ── */

      --g-100: #FFF4CC;

      --g-300: #FFD700;

      --g-500: #C8960C;

      --g-700: #7A5800;

      --g-900: #3D2C00;



      /* ── RED ── */

      --r-100: #FFE5E5;

      --r-300: #FF6666;

      --r-500: #FF3333;

      --r-700: #CC0000;

      --r-900: #550000;



      /* ── PEACH ── */

      --p-100: #FFF0EB;

      --p-300: #FFBFA8;

      --p-500: #FF8C69;

      --p-700: #C45A35;

      --p-900: #5C2010;



      /* ── SEMANTIC ALIASES ── */

      --bg:           var(--d-900);

      --surface:      var(--d-800);

      --header:       var(--d-700);

      --border-1:     var(--d-600);

      --border-2:     var(--d-500);

      --text-primary: var(--w-100);

      --text-6:       #383838;



      --font: 'IBM Plex Mono', monospace;

      --tooth: 9px;

    }

    body { background: var(--bg); color: var(--text-primary); font-family: var(--font); }

    ::-webkit-scrollbar { width: 4px; }

    ::-webkit-scrollbar-track { background: var(--bg); }

    ::-webkit-scrollbar-thumb { background: var(--border-2); }



    @keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.2} }

    @keyframes scroll-up { 0%{transform:translateY(0)} 100%{transform:translateY(-50%)} }

    @keyframes spin-slow  { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

    @keyframes progress-fill { from{width:0} to{width:var(--fill)} }

    @keyframes toast-in { from{transform:translateX(120%);opacity:0} to{transform:translateX(0);opacity:1} }



    .pulse-anim  { animation: pulse-dot 1400ms ease-in-out infinite; }

    .scroll-anim { animation: scroll-up 12s linear infinite; }

    .spin-slow   { animation: spin-slow 8s linear infinite; }

    .toast-anim  { animation: toast-in 0.3s ease forwards; }



    .punched-frame { position: relative; }

    .punched-frame::before,

    .punched-frame::after {

      content: '';

      position: absolute;

      left: 0; right: 0;

      height: var(--tooth);

      z-index: 20;

      pointer-events: none;

      background: repeating-linear-gradient(

        90deg,

        transparent 0px, transparent 8px,

        var(--bg) 8px, var(--bg) 18px

      );

    }

    .punched-frame::before { top: 0; }

    .punched-frame::after  { bottom: 0; }

  `}</style>
);

const GrainOverlay = ({ strength = 0.18 }) => {
  const canvasRef = useRef(null);
  useEffect(() => {
    const canvas = canvasRef.current;
    if (!canvas) return;
    const ctx = canvas.getContext("2d");
    const W = 256, H = 256;
    canvas.width = W; canvas.height = H;
    const imageData = ctx.createImageData(W, H);
    const data = imageData.data;
    for (let i = 0; i < data.length; i += 4) {
      const v = (Math.random() * 255) | 0;
      data[i] = data[i + 1] = data[i + 2] = v;
      data[i + 3] = (strength * 255) | 0;
    }
    ctx.putImageData(imageData, 0, 0);
  }, [strength]);
  return (
    <canvas ref={canvasRef} style={{

      position: "absolute", inset: 0, width: "100%", height: "100%",

      pointerEvents: "none", mixBlendMode: "overlay", opacity: 0.9, zIndex: 5

    }} />
  );
};

const GeometricOverlay = () => (
  <svg style={{ position: "absolute", inset: 0, width: "100%", height: "100%", pointerEvents: "none", zIndex: 4, opacity: 0.07 }} preserveAspectRatio="xMidYMid slice">

    <defs>

      <pattern id="lattice" width="32" height="32" patternUnits="userSpaceOnUse">

        <path d="M 32 0 L 0 0 0 32" fill="none" stroke="white" strokeWidth="0.5" />

        <circle cx="0" cy="0" r="1" fill="white" opacity="0.5" />

      </pattern>

    </defs>

    <rect width="100%" height="100%" fill="url(#lattice)" />

    <circle cx="50%" cy="50%" r="80" fill="none" stroke="white" strokeWidth="0.5" />

    <circle cx="50%" cy="50%" r="140" fill="none" stroke="white" strokeWidth="0.3" />

    <line x1="50%" y1="0" x2="50%" y2="100%" stroke="white" strokeWidth="0.3" />

    <line x1="0" y1="50%" x2="100%" y2="50%" stroke="white" strokeWidth="0.3" />

    <polygon points="50%,10% 90%,90% 10%,90%" fill="none" stroke="white" strokeWidth="0.4" opacity="0.5" />

  </svg>
);

const PunchHoles = () => (
  <>

    {[{ top: "3px", left: "4px" }, { top: "3px", right: "4px" }, { bottom: "3px", left: "4px" }, { bottom: "3px", right: "4px" }].map((pos, i) => (

      <div key={i} style={{

        position: "absolute", ...pos, width: 9, height: 9, borderRadius: "50%",

        background: "radial-gradient(circle, var(--bg) 4px, transparent 4px)",

        border: "1px solid var(--d-500)", zIndex: 25, pointerEvents: "none",

      }} />

    ))}

  </>
);

const Punched = ({ children, style = {}, className = "" }) => (
  <div className={`punched-frame ${className}`} style={{ position: "relative", ...style }}>

    <PunchHoles />

    {children}

  </div>
);

const TicketShell = ({ children, stubHeight = 60, style = {} }) => (
  <Punched style={style}>

    <div style={{

      background: "var(--surface)", border: "1px solid var(--border-1)",

      boxShadow: "0 40px 100px rgba(0,0,0,0.95)", position: "relative", overflow: "hidden"

    }}>

      <svg style={{ position: "absolute", inset: 0, width: "100%", height: "100%", pointerEvents: "none", zIndex: 6 }}>

        <rect x="8" y="8" width="calc(100% - 16px)" height="calc(100% - 16px)"

          fill="none" stroke="var(--d-500)" strokeWidth="1" strokeDasharray="4 3" />

      </svg>

      <GrainOverlay />

      <GeometricOverlay />

      {stubHeight > 0 && (

        <div style={{

          position: "absolute", bottom: stubHeight, left: 0, right: 0, zIndex: 8,

          borderTop: "1px dashed var(--border-2)", display: "flex", alignItems: "center", justifyContent: "center"

        }}>

          <span style={{

            background: "var(--surface)", padding: "0 8px", fontSize: 7, color: "var(--w-500)",

            letterSpacing: "0.2em", fontFamily: "var(--font)"

          }}>βœ‚ TEAR</span>

        </div>

      )}

      {children}

    </div>

  </Punched>
);

const Barcode = ({ value = "OMEGA-7749-XX", width = 120, height = 28 }) => {
  const bars = [];
  for (let i = 0; i < 48; i++)
    bars.push({ x: i * (width / 48), w: Math.random() > 0.5 ? 1.5 : 0.8, o: 0.4 + Math.random() * 0.6 });
  return (
    <div style={{ display: "flex", flexDirection: "column", alignItems: "center", gap: 2 }}>

      <svg width={width} height={height} style={{ display: "block" }}>

        {bars.map((b, i) => <rect key={i} x={b.x} y={0} width={b.w} height={height} fill="var(--w-300)" opacity={b.o} />)}

      </svg>

      <span style={{ fontSize: 6, letterSpacing: "0.28em", color: "var(--w-500)", fontFamily: "var(--font)", textTransform: "uppercase" }}>{value}</span>

    </div>
  );
};

const StatusPill = ({ status = "active", label, pulse = true }) => {
  const colors = {
    active: "var(--g-300)",
    inactive: "var(--w-500)",
    warning: "var(--p-500)",
    danger: "var(--r-500)",
    pending: "var(--g-100)",
  };
  const color = colors[status] || colors.active;
  return (
    <div style={{

      display: "inline-flex", alignItems: "center", gap: 6, padding: "3px 8px",

      border: `1px solid ${color}33`, background: `${color}0d`, borderRadius: 2

    }}>

      <div className={pulse ? "pulse-anim" : ""} style={{

        width: 5, height: 5, borderRadius: "50%",

        background: color, boxShadow: `0 0 6px ${color}`

      }} />

      <span style={{ fontSize: 8, letterSpacing: "0.28em", color, fontFamily: "var(--font)", textTransform: "uppercase" }}>

        {label || status}

      </span>

    </div>
  );
};

const TerminalMask = ({ lines = [], size = 120 }) => {
  const defaultLines = [
    "CLASSIFIED // OMEGA PROTOCOL", "ACCESS GRANTED β€” NEXUS-7", "THREAT LEVEL: CRITICAL",
    "SYNC: 99.7% COMPLETE", "FIREWALL: ACTIVE", "ENCRYPTION: AES-512",
    "NODE: 192.168.0.77", "UPTIME: 847:22:11", "AGENT: SPECTRE-9", "STATUS: OPERATIONAL", ...lines
  ];
  const doubled = [...defaultLines, ...defaultLines];
  return (
    <div style={{

      width: size, height: size, borderRadius: "50%", overflow: "hidden", position: "relative",

      border: "1px solid var(--d-500)", background: "var(--bg)",

      boxShadow: "inset 0 0 20px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.6)"

    }}>

      <div className="scroll-anim" style={{ position: "absolute", width: "100%", paddingTop: 8 }}>

        {doubled.map((line, i) => (

          <div key={i} style={{

            padding: "1.5px 8px", fontSize: 6.5, letterSpacing: "0.18em",

            color: i % 3 === 0 ? "var(--g-300)" : "var(--w-500)",

            fontFamily: "var(--font)", textTransform: "uppercase", whiteSpace: "nowrap", overflow: "hidden"

          }}>{line}</div>

        ))}

      </div>

      <div style={{

        position: "absolute", inset: 0, borderRadius: "50%",

        background: "radial-gradient(circle, transparent 40%, var(--bg) 80%)", pointerEvents: "none"

      }} />

    </div>
  );
};

const Divider = ({ label }) => (
  <div style={{ display: "flex", alignItems: "center", gap: 10, padding: "4px 0" }}>

    <div style={{ flex: 1, height: 1, background: "var(--border-1)" }} />

    {label

      ? <span style={{ fontSize: 7, letterSpacing: "0.28em", color: "var(--w-500)", textTransform: "uppercase", fontFamily: "var(--font)" }}>{label}</span>

      : <svg width="8" height="8"><polygon points="4,0 8,4 4,8 0,4" fill="var(--d-500)" /></svg>

    }

    <div style={{ flex: 1, height: 1, background: "var(--border-1)" }} />

  </div>
);

const SectionLabel = ({ children, sub }) => (
  <div style={{ marginBottom: 20 }}>

    <div style={{ display: "flex", alignItems: "center", gap: 8 }}>

      <div style={{ width: 2, height: 14, background: "var(--g-300)" }} />

      <span style={{

        fontSize: 9.5, fontWeight: 700, letterSpacing: "0.34em", textTransform: "uppercase",

        fontFamily: "var(--font)", color: "var(--w-100)"

      }}>{children}</span>

    </div>

    {sub && <div style={{

      marginTop: 4, marginLeft: 10, fontSize: 7, letterSpacing: "0.2em",

      color: "var(--g-700)", textTransform: "uppercase", fontFamily: "var(--font)"

    }}>{sub}</div>}

  </div>
);

const Micro = ({ children, color = "var(--text-6)" }) => (
  <span style={{ fontSize: 7, letterSpacing: "0.28em", color, fontFamily: "var(--font)", textTransform: "uppercase" }}>{children}</span>
);

// ── 1. HEADER ──────────────────────────────────────────────────
const Header = ({ activeTab, setActiveTab }) => {
  const navItems = ["DASHBOARD", "INTEL", "ASSETS", "COMMS", "SYSTEM"];
  return (
    <Punched style={{ zIndex: 100 }}>

      <div style={{

        position: "relative", background: "var(--header)", borderBottom: "1px solid var(--border-1)",

        height: 52, display: "flex", alignItems: "center", padding: "0 24px", gap: 24, overflow: "hidden"

      }}>

        <GrainOverlay strength={0.1} />

        <div style={{ display: "flex", alignItems: "center", gap: 10, zIndex: 7 }}>

          <svg width="18" height="18" viewBox="0 0 18 18">

            <polygon points="9,1 17,5 17,13 9,17 1,13 1,5" fill="none" stroke="var(--g-300)" strokeWidth="1.5" />

            <polygon points="9,5 13,7 13,11 9,13 5,11 5,7" fill="var(--g-500)" opacity="0.3" />

            <circle cx="9" cy="9" r="2" fill="var(--g-300)" />

          </svg>

          <div>

            <div style={{

              fontSize: 11, fontWeight: 700, letterSpacing: "0.22em", textTransform: "uppercase",

              fontFamily: "var(--font)", color: "var(--w-100)"

            }}>NEXUS</div>

            <div style={{ fontSize: 6.5, letterSpacing: "0.34em", color: "var(--g-500)", textTransform: "uppercase", fontFamily: "var(--font)" }}>OMEGA PROTOCOL</div>

          </div>

        </div>

        <div style={{ width: 1, height: 28, background: "var(--border-1)", zIndex: 7 }} />

        <div style={{ display: "flex", gap: 2, zIndex: 7 }}>

          {navItems.map(item => (

            <button key={item} onClick={() => setActiveTab(item)} style={{

              background: activeTab === item ? "rgba(255,215,0,0.06)" : "transparent",

              border: activeTab === item ? "1px solid var(--g-700)" : "1px solid transparent",

              color: activeTab === item ? "var(--g-300)" : "var(--w-500)",

              padding: "5px 12px", cursor: "pointer", fontFamily: "var(--font)",

              fontSize: 8, letterSpacing: "0.22em", textTransform: "uppercase", transition: "all 0.2s"

            }}>

              {item}

              {activeTab === item && <div style={{ width: "100%", height: 1, background: "var(--g-300)", marginTop: 2 }} />}

            </button>

          ))}

        </div>

        <div style={{ flex: 1 }} />

        <div style={{ display: "flex", alignItems: "center", gap: 14, zIndex: 7 }}>

          <StatusPill status="active" label="SYS ONLINE" />

          <div style={{ textAlign: "right" }}>

            <div style={{ fontSize: 8, letterSpacing: "0.2em", color: "var(--w-300)", textTransform: "uppercase", fontFamily: "var(--font)" }}>AGT-09</div>

            <div style={{ fontSize: 6.5, letterSpacing: "0.18em", color: "var(--g-500)", textTransform: "uppercase", fontFamily: "var(--font)" }}>CLEARANCE: OMEGA</div>

          </div>

          <div style={{

            width: 28, height: 28, borderRadius: "50%", border: "1px solid var(--g-700)",

            background: "var(--surface)", display: "flex", alignItems: "center", justifyContent: "center",

            fontSize: 9, color: "var(--g-300)", fontFamily: "var(--font)"

          }}>Ξ©</div>

        </div>

      </div>

    </Punched>
  );
};

// ── 2. BUTTON ──────────────────────────────────────────────────
const Button = ({ variant = "primary", children, icon, size = "md", disabled, onClick }) => {
  const sizes = { sm: "4px 10px", md: "7px 16px", lg: "10px 22px" };
  const fontSizes = { sm: 7.5, md: 8.5, lg: 9.5 };
  const bases = {
    primary: { bg: "var(--g-300)", color: "var(--d-900)", border: "1px solid var(--g-300)" },
    secondary: { bg: "rgba(255,215,0,0.06)", color: "var(--g-300)", border: "1px solid var(--g-700)" },
    outline: { bg: "transparent", color: "var(--w-100)", border: "1px solid var(--w-300)" },
    ghost: { bg: "transparent", color: "var(--w-500)", border: "1px solid transparent" },
    danger: { bg: "rgba(255,51,51,0.10)", color: "var(--r-500)", border: "1px solid var(--r-700)" },
    success: { bg: "rgba(255,215,0,0.08)", color: "var(--g-300)", border: "1px solid var(--g-700)" },
  };
  const s = bases[variant] || bases.primary;
  return (
    <button onClick={onClick} disabled={disabled} style={{

      background: s.bg, color: s.color, border: s.border,

      padding: sizes[size], fontFamily: "var(--font)",

      fontSize: fontSizes[size], letterSpacing: "0.22em", textTransform: "uppercase",

      cursor: disabled ? "not-allowed" : "pointer", opacity: disabled ? 0.4 : 1,

      display: "inline-flex", alignItems: "center", gap: 6,

      position: "relative", overflow: "hidden", transition: "all 0.2s", outline: "none",

    }}>

      {["top:2px;left:2px", "top:2px;right:2px", "bottom:2px;left:2px", "bottom:2px;right:2px"].map((pos, i) => {

        const st = pos.split(";").reduce((a, p) => { const [k, v] = p.split(":"); a[k] = v; return a; }, {});

        return <div key={i} style={{ position: "absolute", ...st, width: 2, height: 2, background: s.color, opacity: 0.5 }} />;

      })}

      {icon && <span style={{ fontSize: fontSizes[size] * 1.1 }}>{icon}</span>}

      {children}

    </button>
  );
};

// ── 3. INPUT ───────────────────────────────────────────────────
const Input = ({ placeholder, label, type = "text", value, onChange, prefix, suffix, hint }) => (
  <div style={{ display: "flex", flexDirection: "column", gap: 5 }}>

    {label && <label style={{ fontSize: 7.5, letterSpacing: "0.28em", color: "var(--g-500)", textTransform: "uppercase", fontFamily: "var(--font)" }}>{label}</label>}

    <div style={{

      position: "relative", background: "var(--surface)", border: "1px solid var(--border-1)",

      display: "flex", alignItems: "center", overflow: "hidden"

    }}>

      {prefix && <span style={{ padding: "0 8px", fontSize: 8, color: "var(--g-500)", fontFamily: "var(--font)", borderRight: "1px solid var(--border-1)" }}>{prefix}</span>}

      <input type={type} placeholder={placeholder} value={value} onChange={onChange} style={{

        flex: 1, background: "transparent", border: "none", outline: "none",

        color: "var(--w-100)", fontFamily: "var(--font)", fontSize: 9, letterSpacing: "0.14em", padding: "9px 12px",

      }} />

      {suffix && <span style={{ padding: "0 8px", fontSize: 8, color: "var(--g-500)", fontFamily: "var(--font)", borderLeft: "1px solid var(--border-1)" }}>{suffix}</span>}

      <div style={{ position: "absolute", inset: 2, border: "1px dashed var(--border-1)", pointerEvents: "none" }} />

    </div>

    {hint && <div style={{ fontSize: 7, letterSpacing: "0.18em", color: "var(--g-700)", fontFamily: "var(--font)", textTransform: "uppercase" }}>{hint}</div>}

  </div>
);

// ── 4. CARD ────────────────────────────────────────────────────
const Card = ({ children, title, sub, tag, style = {} }) => (
  <Punched style={style}>

    <div style={{ position: "relative", background: "var(--surface)", border: "1px solid var(--border-1)", overflow: "hidden" }}>

      <GrainOverlay strength={0.12} />

      {["top:0;left:0", "top:0;right:0", "bottom:0;left:0", "bottom:0;right:0"].map((pos, i) => {

        const st = pos.split(";").reduce((a, p) => { const [k, v] = p.split(":"); a[k] = v; return a; }, {});

        return (

          <div key={i} style={{

            position: "absolute", ...st, width: 12, height: 12, zIndex: 7,

            borderTop: i < 2 ? "1px solid var(--g-700)" : "none",

            borderBottom: i >= 2 ? "1px solid var(--g-700)" : "none",

            borderLeft: (i === 0 || i === 2) ? "1px solid var(--g-700)" : "none",

            borderRight: (i === 1 || i === 3) ? "1px solid var(--g-700)" : "none",

          }} />

        );

      })}

      {(title || sub || tag) && (

        <div style={{ padding: "10px 14px 8px", borderBottom: "1px solid var(--border-1)", position: "relative", zIndex: 7 }}>

          <div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-start" }}>

            <div>

              {title && <div style={{

                fontSize: 9.5, fontWeight: 600, letterSpacing: "0.22em", textTransform: "uppercase",

                fontFamily: "var(--font)", color: "var(--w-100)"

              }}>{title}</div>}

              {sub && <div style={{

                fontSize: 7, letterSpacing: "0.18em", color: "var(--g-500)", textTransform: "uppercase",

                fontFamily: "var(--font)", marginTop: 3

              }}>{sub}</div>}

            </div>

            {tag && <div style={{

              fontSize: 7, padding: "2px 7px", border: "1px solid var(--g-700)", color: "var(--g-500)",

              letterSpacing: "0.2em", textTransform: "uppercase", fontFamily: "var(--font)"

            }}>{tag}</div>}

          </div>

        </div>

      )}

      <div style={{ padding: 14, position: "relative", zIndex: 7 }}>{children}</div>

    </div>

  </Punched>
);

// ── 5. BADGE ───────────────────────────────────────────────────
const Badge = ({ children, variant = "default" }) => {
  const vars = {
    default: { bg: "var(--surface)", color: "var(--w-400)", border: "1px solid var(--border-2)" },
    active: { bg: "rgba(255,215,0,0.08)", color: "var(--g-300)", border: "1px solid var(--g-700)" },
    danger: { bg: "rgba(255,51,51,0.08)", color: "var(--r-500)", border: "1px solid var(--r-700)" },
    warning: { bg: "rgba(255,140,105,0.08)", color: "var(--p-500)", border: "1px solid var(--p-700)" },
    omega: { bg: "rgba(255,244,204,0.05)", color: "var(--g-100)", border: "1px solid var(--g-700)" },
  };
  const v = vars[variant] || vars.default;
  return (
    <span style={{

      ...v, display: "inline-block", padding: "2px 7px", fontSize: 7,

      letterSpacing: "0.22em", textTransform: "uppercase", fontFamily: "var(--font)"

    }}>{children}</span>
  );
};

// ── 6. PROGRESS BAR ────────────────────────────────────────────
const ProgressBar = ({ value = 65, label, color = "var(--g-300)" }) => (
  <div style={{ display: "flex", flexDirection: "column", gap: 4 }}>

    {label && (

      <div style={{ display: "flex", justifyContent: "space-between" }}>

        <Micro color="var(--w-500)">{label}</Micro>

        <Micro color="var(--g-500)">{value}%</Micro>

      </div>

    )}

    <div style={{ height: 3, background: "var(--border-1)", position: "relative", overflow: "hidden" }}>

      <div style={{

        "--fill": `${value}%`, width: `${value}%`, height: "100%", background: color,

        animation: "progress-fill 1.5s ease forwards", boxShadow: `0 0 8px ${color}`

      }} />

      {[25, 50, 75].map(t => (

        <div key={t} style={{ position: "absolute", top: 0, left: `${t}%`, width: 1, height: "100%", background: "var(--border-2)" }} />

      ))}

    </div>

  </div>
);

// ── 7. SPINNER ─────────────────────────────────────────────────
const Spinner = ({ size = 32 }) => (
  <div style={{ position: "relative", width: size, height: size }}>

    <div className="spin-slow" style={{

      width: "100%", height: "100%",

      border: "1px solid var(--border-2)", borderTop: "1px solid var(--g-300)", borderRadius: "50%"

    }} />

    <div style={{ position: "absolute", inset: 4, border: "1px dashed var(--g-700)", borderRadius: "50%" }} />

    <div style={{

      position: "absolute", inset: "50%", transform: "translate(-50%,-50%)",

      width: 4, height: 4, background: "var(--g-300)", borderRadius: "50%"

    }} />

  </div>
);

// ── 8. TABS ────────────────────────────────────────────────────
const Tabs = ({ tabs, active, onSelect }) => (
  <div style={{ borderBottom: "1px solid var(--border-1)", display: "flex", gap: 0 }}>

    {tabs.map((tab, i) => (

      <button key={i} onClick={() => onSelect(i)} style={{

        background: active === i ? "rgba(255,215,0,0.04)" : "transparent",

        border: "none", borderBottom: active === i ? "1px solid var(--g-300)" : "1px solid transparent",

        color: active === i ? "var(--g-300)" : "var(--w-500)",

        padding: "8px 16px", cursor: "pointer", fontFamily: "var(--font)",

        fontSize: 8, letterSpacing: "0.22em", textTransform: "uppercase", position: "relative", marginBottom: -1,

      }}>

        {active === i && <div style={{ position: "absolute", top: 0, left: 0, right: 0, height: 1, background: "var(--g-700)" }} />}

        {tab}

      </button>

    ))}

  </div>
);

// ── 9. ACCORDION ───────────────────────────────────────────────
const AccordionItem = ({ title, children }) => {
  const [open, setOpen] = useState(false);
  return (
    <div style={{ borderBottom: "1px solid var(--border-1)" }}>

      <button onClick={() => setOpen(!open)} style={{

        width: "100%", background: "transparent", border: "none", padding: "10px 14px",

        display: "flex", justifyContent: "space-between", alignItems: "center",

        cursor: "pointer", color: "var(--w-300)", fontFamily: "var(--font)",

        fontSize: 8.5, letterSpacing: "0.22em", textTransform: "uppercase",

      }}>

        <span>{title}</span>

        <svg width="10" height="10" style={{ transform: open ? "rotate(180deg)" : "rotate(0deg)", transition: "transform 0.2s" }}>

          <polygon points="5,7 0,0 10,0" fill="var(--g-500)" />

        </svg>

      </button>

      {open && (

        <div style={{

          padding: "8px 14px 12px", color: "var(--w-500)", fontSize: 8.5, lineHeight: 1.7,

          fontFamily: "var(--font)", letterSpacing: "0.1em", borderTop: "1px dashed var(--border-1)"

        }}>

          {children}

        </div>

      )}

    </div>
  );
};

// ── 10. TOOLTIP ────────────────────────────────────────────────
const Tooltip = ({ label, children }) => {
  const [show, setShow] = useState(false);
  return (
    <div style={{ position: "relative", display: "inline-block" }}

      onMouseEnter={() => setShow(true)} onMouseLeave={() => setShow(false)}>

      {children}

      {show && (

        <div style={{

          position: "absolute", bottom: "calc(100% + 6px)", left: "50%", transform: "translateX(-50%)",

          background: "var(--header)", border: "1px solid var(--g-700)", padding: "5px 10px",

          whiteSpace: "nowrap", zIndex: 200, pointerEvents: "none"

        }}>

          <span style={{

            fontSize: 7.5, letterSpacing: "0.18em", color: "var(--g-300)",

            fontFamily: "var(--font)", textTransform: "uppercase"

          }}>{label}</span>

          <div style={{

            position: "absolute", bottom: -4, left: "50%", transform: "translateX(-50%)", width: 6, height: 4,

            background: "var(--header)", borderRight: "1px solid var(--g-700)", borderBottom: "1px solid var(--g-700)",

            transformOrigin: "center", rotate: "45deg"

          }} />

        </div>

      )}

    </div>
  );
};

// ── 11. DATA TABLE ─────────────────────────────────────────────
const DataTable = ({ columns, rows }) => (
  <Punched>

    <div style={{ border: "1px solid var(--border-1)", overflow: "hidden", position: "relative" }}>

      <GrainOverlay strength={0.08} />

      <div style={{

        display: "grid", gridTemplateColumns: `repeat(${columns.length}, 1fr)`,

        borderBottom: "1px solid var(--border-2)", background: "var(--header)", position: "relative", zIndex: 7

      }}>

        {columns.map((col, i) => (

          <div key={i} style={{

            padding: "8px 12px", fontSize: 7.5, letterSpacing: "0.22em",

            textTransform: "uppercase", color: "var(--g-500)", fontFamily: "var(--font)",

            borderRight: i < columns.length - 1 ? "1px solid var(--border-1)" : "none"

          }}>

            {col}

          </div>

        ))}

      </div>

      {rows.map((row, ri) => (

        <div key={ri} style={{

          display: "grid", gridTemplateColumns: `repeat(${columns.length}, 1fr)`,

          borderBottom: ri < rows.length - 1 ? "1px solid var(--border-1)" : "none",

          background: ri % 2 === 0 ? "transparent" : "rgba(255,215,0,0.01)", position: "relative", zIndex: 7

        }}>

          {row.map((cell, ci) => (

            <div key={ci} style={{

              padding: "7px 12px", fontSize: 8, letterSpacing: "0.12em",

              color: ci === 0 ? "var(--w-200)" : "var(--w-500)", fontFamily: "var(--font)",

              borderRight: ci < row.length - 1 ? "1px solid var(--border-1)" : "none"

            }}>

              {cell}

            </div>

          ))}

        </div>

      ))}

    </div>

  </Punched>
);

// ── 12. TOGGLE ─────────────────────────────────────────────────
const Toggle = ({ checked, onChange, label }) => (
  <div style={{ display: "flex", alignItems: "center", gap: 10 }}>

    <div onClick={onChange} style={{

      cursor: "pointer", width: 40, height: 16, position: "relative",

      background: checked ? "rgba(255,215,0,0.1)" : "var(--surface)",

      border: `1px solid ${checked ? "var(--g-700)" : "var(--border-1)"}`

    }}>

      {[...Array(8)].map((_, i) => (

        <div key={i} style={{

          position: "absolute", top: 2, bottom: 2, left: 4 + i * 4, width: 1,

          background: "var(--border-2)", opacity: checked ? 1 : 0.4

        }} />

      ))}

      <div style={{

        position: "absolute", top: 1, width: 12, height: 12,

        background: checked ? "var(--g-300)" : "var(--border-2)",

        left: checked ? "calc(100% - 14px)" : 1,

        transition: "all 0.2s", boxShadow: checked ? "0 0 8px var(--g-500)" : "none",

        display: "flex", alignItems: "center", justifyContent: "center",

        fontSize: 5, color: checked ? "var(--d-900)" : "transparent"

      }}>β– </div>

    </div>

    {label && <span style={{

      fontSize: 8, letterSpacing: "0.18em", color: "var(--w-400)",

      fontFamily: "var(--font)", textTransform: "uppercase"

    }}>{label}</span>}

  </div>
);

// ── 13. ALERT ──────────────────────────────────────────────────
const Alert = ({ type = "info", title, message, onClose }) => {
  const types = {
    info: { color: "var(--w-300)", border: "var(--border-2)", icon: "β—ˆ" },
    success: { color: "var(--g-300)", border: "var(--g-700)", icon: "βœ“" },
    warning: { color: "var(--p-500)", border: "var(--p-700)", icon: "⚠" },
    danger: { color: "var(--r-500)", border: "var(--r-700)", icon: "βœ•" },
  };
  const t = types[type] || types.info;
  return (
    <Punched>

      <div className="toast-anim" style={{

        background: "var(--surface)", border: `1px solid ${t.border}`,

        padding: "10px 14px", position: "relative", overflow: "hidden", display: "flex", gap: 10, alignItems: "flex-start"

      }}>

        <GrainOverlay strength={0.1} />

        <span style={{ fontSize: 14, color: t.color, zIndex: 7 }}>{t.icon}</span>

        <div style={{ flex: 1, zIndex: 7 }}>

          {title && <div style={{

            fontSize: 9, fontWeight: 600, letterSpacing: "0.2em", color: t.color,

            textTransform: "uppercase", fontFamily: "var(--font)", marginBottom: 3

          }}>{title}</div>}

          <div style={{ fontSize: 8, letterSpacing: "0.14em", color: "var(--w-500)", fontFamily: "var(--font)" }}>{message}</div>

        </div>

        {onClose && <button onClick={onClose} style={{

          background: "none", border: "none",

          color: "var(--w-500)", cursor: "pointer", fontSize: 10, zIndex: 7

        }}>Γ—</button>}

      </div>

    </Punched>
  );
};

// ── 14. BREADCRUMBS ────────────────────────────────────────────
const Breadcrumbs = ({ items }) => (
  <div style={{ display: "flex", alignItems: "center", gap: 6 }}>

    {items.map((item, i) => (

      <div key={i} style={{ display: "flex", alignItems: "center", gap: 6 }}>

        <span style={{

          fontSize: 8, letterSpacing: "0.18em",

          color: i === items.length - 1 ? "var(--g-300)" : "var(--w-500)",

          textTransform: "uppercase", fontFamily: "var(--font)", cursor: i < items.length - 1 ? "pointer" : "default"

        }}>

          {item}

        </span>

        {i < items.length - 1 && (

          <svg width="6" height="6"><polygon points="3,0 6,3 3,6 0,3" fill="var(--g-700)" /></svg>

        )}

      </div>

    ))}

  </div>
);

// ── 15. STEPPER ────────────────────────────────────────────────
const Stepper = ({ steps, current }) => (
  <div style={{ display: "flex", alignItems: "center" }}>

    {steps.map((step, i) => (

      <div key={i} style={{ display: "flex", alignItems: "center", flex: i < steps.length - 1 ? 1 : "none" }}>

        <div style={{ display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }}>

          <div style={{

            width: 24, height: 24,

            border: `1px solid ${i <= current ? "var(--g-300)" : "var(--border-2)"}`,

            background: i < current ? "var(--g-300)" : i === current ? "rgba(255,215,0,0.1)" : "transparent",

            display: "flex", alignItems: "center", justifyContent: "center",

            fontSize: 7.5, color: i < current ? "var(--d-900)" : i === current ? "var(--g-300)" : "var(--w-500)",

            fontFamily: "var(--font)", fontWeight: 700, letterSpacing: "0.1em"

          }}>

            {i < current ? "βœ“" : i + 1}

          </div>

          <span style={{

            fontSize: 7, letterSpacing: "0.16em",

            color: i <= current ? "var(--g-300)" : "var(--w-500)",

            textTransform: "uppercase", fontFamily: "var(--font)", whiteSpace: "nowrap"

          }}>{step}</span>

        </div>

        {i < steps.length - 1 && (

          <div style={{

            flex: 1, height: 1, background: i < current ? "var(--g-500)" : "var(--border-1)",

            margin: "0 8px", marginBottom: 14

          }} />

        )}

      </div>

    ))}

  </div>
);

// ── 16. SELECT ─────────────────────────────────────────────────
const Select = ({ label, options, value, onChange }) => {
  const [open, setOpen] = useState(false);
  return (
    <div style={{ position: "relative", display: "flex", flexDirection: "column", gap: 5 }}>

      {label && <label style={{

        fontSize: 7.5, letterSpacing: "0.28em", color: "var(--g-500)",

        textTransform: "uppercase", fontFamily: "var(--font)"

      }}>{label}</label>}

      <div onClick={() => setOpen(!open)} style={{

        background: "var(--surface)", border: "1px solid var(--border-1)",

        padding: "9px 12px", cursor: "pointer", display: "flex", justifyContent: "space-between",

        alignItems: "center", position: "relative"

      }}>

        <span style={{

          fontSize: 9, letterSpacing: "0.14em", fontFamily: "var(--font)",

          color: value ? "var(--w-100)" : "var(--w-500)"

        }}>

          {value || "β€” SELECT OPTION β€”"}

        </span>

        <svg width="8" height="8" style={{ transform: open ? "rotate(180deg)" : "none", transition: "transform 0.2s" }}>

          <polygon points="4,6 0,0 8,0" fill="var(--g-500)" />

        </svg>

        <div style={{ position: "absolute", inset: 2, border: "1px dashed var(--border-1)", pointerEvents: "none" }} />

      </div>

      {open && (

        <div style={{

          position: "absolute", top: "calc(100% + 2px)", left: 0, right: 0, background: "var(--header)",

          border: "1px solid var(--g-700)", zIndex: 100, overflow: "hidden"

        }}>

          {options.map((opt, i) => (

            <div key={i} onClick={() => { onChange(opt); setOpen(false); }} style={{

              padding: "8px 12px", cursor: "pointer", fontSize: 8.5, letterSpacing: "0.14em",

              fontFamily: "var(--font)", color: "var(--w-400)", textTransform: "uppercase",

              borderBottom: i < options.length - 1 ? "1px solid var(--border-1)" : "none", transition: "background 0.1s",

            }}

              onMouseEnter={e => e.currentTarget.style.background = "rgba(255,215,0,0.05)"}

              onMouseLeave={e => e.currentTarget.style.background = "transparent"}>

              <div style={{ display: "flex", alignItems: "center", gap: 8 }}>

                <div style={{ width: 3, height: 3, background: "var(--g-500)" }} />{opt}

              </div>

            </div>

          ))}

        </div>

      )}

    </div>
  );
};

// ── 17. MODAL ──────────────────────────────────────────────────
const Modal = ({ open, onClose, title, children }) => {
  if (!open) return null;
  return (
    <div style={{

      position: "fixed", inset: 0, background: "rgba(0,0,0,0.85)", zIndex: 1000,

      display: "flex", alignItems: "center", justifyContent: "center", backdropFilter: "blur(4px)"

    }}>

      <div style={{ position: "relative", maxWidth: 480, width: "90%", maxHeight: "80vh", overflow: "hidden" }}>

        <TicketShell stubHeight={0}>

          <div style={{ padding: "20px 20px 16px", position: "relative", zIndex: 8 }}>

            <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 }}>

              <div>

                <div style={{

                  fontSize: 7, letterSpacing: "0.28em", color: "var(--g-700)",

                  fontFamily: "var(--font)", textTransform: "uppercase", marginBottom: 4

                }}>// CLASSIFIED DIALOGUE</div>

                <div style={{

                  fontSize: 11, fontWeight: 700, letterSpacing: "0.22em", textTransform: "uppercase",

                  fontFamily: "var(--font)", color: "var(--g-300)"

                }}>{title}</div>

              </div>

              <button onClick={onClose} style={{

                background: "transparent", border: "1px solid var(--g-700)",

                color: "var(--g-500)", width: 24, height: 24, cursor: "pointer", fontFamily: "var(--font)", fontSize: 10,

                display: "flex", alignItems: "center", justifyContent: "center"

              }}>Γ—</button>

            </div>

            <Divider />

            <div style={{

              marginTop: 14, color: "var(--w-400)", fontSize: 8.5, lineHeight: 1.7,

              letterSpacing: "0.12em", fontFamily: "var(--font)"

            }}>{children}</div>

            <div style={{ marginTop: 18, display: "flex", gap: 8, justifyContent: "flex-end" }}>

              <Button variant="ghost" onClick={onClose}>CANCEL</Button>

              <Button variant="primary" onClick={onClose}>CONFIRM</Button>

            </div>

          </div>

        </TicketShell>

      </div>

    </div>
  );
};

// ── 18. AVATAR ─────────────────────────────────────────────────
const Avatar = ({ initials = "Ξ©", status }) => (
  <div style={{ position: "relative", width: 40, height: 40 }}>

    <div style={{

      width: "100%", height: "100%", borderRadius: "50%", background: "var(--surface)",

      border: "1px solid var(--g-700)", display: "flex", alignItems: "center", justifyContent: "center",

      overflow: "hidden", position: "relative"

    }}>

      <GeometricOverlay />

      <span style={{ fontSize: 13, color: "var(--g-300)", fontFamily: "var(--font)", zIndex: 7 }}>{initials}</span>

    </div>

    {status && (

      <div className="pulse-anim" style={{

        position: "absolute", bottom: 1, right: 1, width: 7, height: 7,

        borderRadius: "50%", background: "var(--g-300)", border: "1px solid var(--bg)",

        boxShadow: "0 0 6px var(--g-500)"

      }} />

    )}

  </div>
);

// ── 19. FIELDSET ───────────────────────────────────────────────
const Fieldset = ({ legend, children }) => (
  <div style={{ border: "1px solid var(--border-1)", padding: "14px 16px", position: "relative", marginTop: 8 }}>

    <div style={{

      position: "absolute", top: -7, left: 12, background: "var(--bg)", padding: "0 6px",

      fontSize: 7, letterSpacing: "0.28em", color: "var(--g-500)", textTransform: "uppercase", fontFamily: "var(--font)"

    }}>

      {legend}

    </div>

    <div style={{ display: "flex", flexDirection: "column", gap: 14 }}>{children}</div>

  </div>
);

// ── 20. STAT CARD ──────────────────────────────────────────────
const StatCard = ({ label, value, unit, change, trend }) => (
  <Punched>

    <div style={{

      position: "relative", background: "var(--surface)", border: "1px solid var(--border-1)",

      padding: "14px 16px", overflow: "hidden"

    }}>

      <GrainOverlay strength={0.1} />

      <div style={{ position: "relative", zIndex: 7 }}>

        <div style={{

          fontSize: 7, letterSpacing: "0.28em", color: "var(--g-700)", textTransform: "uppercase",

          fontFamily: "var(--font)", marginBottom: 8

        }}>{label}</div>

        <div style={{ display: "flex", alignItems: "baseline", gap: 4 }}>

          <span style={{

            fontSize: 26, fontWeight: 700, letterSpacing: "0.04em",

            fontFamily: "var(--font)", lineHeight: 1, color: "var(--w-100)"

          }}>{value}</span>

          {unit && <span style={{ fontSize: 9, color: "var(--g-500)", fontFamily: "var(--font)", letterSpacing: "0.14em" }}>{unit}</span>}

        </div>

        {change !== undefined && (

          <div style={{

            marginTop: 6, fontSize: 7.5, letterSpacing: "0.18em", fontFamily: "var(--font)",

            color: trend === "up" ? "var(--g-300)" : trend === "down" ? "var(--r-500)" : "var(--w-500)"

          }}>

            {trend === "up" ? "β–²" : trend === "down" ? "β–Ό" : "β€”"} {change}

          </div>

        )}

      </div>

      <div style={{

        position: "absolute", bottom: -20, right: -20, width: 60, height: 60,

        borderRadius: "50%", background: "rgba(255,215,0,0.03)", pointerEvents: "none"

      }} />

    </div>

  </Punched>
);

// ── 21. SIDEBAR ────────────────────────────────────────────────
const Sidebar = ({ activeItem, setActiveItem }) => {
  const items = [
    { icon: "β—ˆ", label: "DASHBOARD", sub: "OVERVIEW" },
    { icon: "β—‰", label: "INTEL", sub: "CLASSIFIED" },
    { icon: "β–£", label: "ASSETS", sub: "INVENTORY" },
    { icon: "β—†", label: "COMMS", sub: "ENCRYPTED" },
    { icon: "⬑", label: "ANALYTICS", sub: "METRICS" },
    { icon: "βŠ•", label: "SETTINGS", sub: "CONFIG" },
  ];
  return (
    <Punched style={{ width: 160 }}>

      <div style={{

        background: "var(--header)", borderRight: "1px solid var(--border-1)",

        display: "flex", flexDirection: "column", position: "relative", overflow: "hidden", height: "100%"

      }}>

        <GrainOverlay strength={0.13} />

        <div style={{

          position: "absolute", right: 0, top: 0, bottom: 0, width: 8,

          background: "repeating-linear-gradient(180deg, transparent 0px, transparent 8px, var(--bg) 8px, var(--bg) 18px)",

          zIndex: 10

        }} />

        <div style={{ padding: "12px 0", flex: 1, position: "relative", zIndex: 7 }}>

          {items.map((item, i) => (

            <button key={i} onClick={() => setActiveItem(item.label)} style={{

              width: "100%", background: activeItem === item.label ? "rgba(255,215,0,0.05)" : "transparent",

              border: "none", borderLeft: activeItem === item.label ? "2px solid var(--g-300)" : "2px solid transparent",

              borderRight: "none", padding: "10px 14px", cursor: "pointer", textAlign: "left",

              borderBottom: i < items.length - 1 ? "1px solid var(--border-1)" : "none",

            }}>

              <div style={{ display: "flex", gap: 8, alignItems: "center" }}>

                <span style={{ fontSize: 11, color: activeItem === item.label ? "var(--g-300)" : "var(--w-500)" }}>{item.icon}</span>

                <div>

                  <div style={{

                    fontSize: 8, fontWeight: 600, letterSpacing: "0.18em", textTransform: "uppercase",

                    color: activeItem === item.label ? "var(--g-300)" : "var(--w-400)", fontFamily: "var(--font)"

                  }}>{item.label}</div>

                  <div style={{ fontSize: 6, letterSpacing: "0.2em", color: "var(--g-700)", textTransform: "uppercase", fontFamily: "var(--font)" }}>{item.sub}</div>

                </div>

              </div>

            </button>

          ))}

        </div>

        <div style={{ padding: "12px 14px", borderTop: "1px solid var(--border-1)", position: "relative", zIndex: 7 }}>

          <Barcode value="AGT-09-NEXUS" width={120} height={16} />

        </div>

      </div>

    </Punched>
  );
};

// ── 22. FOOTER ─────────────────────────────────────────────────
const Footer = () => (
  <Punched style={{ marginTop: 8 }}>

    <div style={{

      position: "relative", background: "var(--header)", borderTop: "1px solid var(--border-1)",

      padding: "12px 24px", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden"

    }}>

      <GrainOverlay strength={0.1} />

      <div style={{ position: "relative", zIndex: 7 }}>

        <Micro color="var(--g-700)">Β© NEXUS PROTOCOL β€” OMEGA DIVISION β€” CLEARANCE REQUIRED</Micro>

      </div>

      <div style={{ position: "relative", zIndex: 7 }}>

        <Barcode value="NEXUS-FOOTER-SYS" width={100} height={14} />

      </div>

      <div style={{ position: "relative", zIndex: 7, display: "flex", gap: 12 }}>

        <Micro color="var(--g-500)">v4.7.2</Micro>

        <Micro color="var(--g-700)">BUILD-20470312</Micro>

      </div>

    </div>

  </Punched>
);

// ══════════════════════════════════════════════════════════════
//  DEMO PAGE
// ══════════════════════════════════════════════════════════════
export default function TicketPunchUIDemo() {
  const [activeNavTab, setActiveNavTab] = useState("DASHBOARD");
  const [activeSideItem, setActiveSideItem] = useState("DASHBOARD");
  const [activeTab, setActiveTab] = useState(0);
  const [toggleA, setToggleA] = useState(true);
  const [toggleB, setToggleB] = useState(false);
  const [modalOpen, setModalOpen] = useState(false);
  const [selectVal, setSelectVal] = useState("");
  const [inputVal, setInputVal] = useState("");

  return (
    <div style={{

      fontFamily: "var(--font)", background: "var(--bg)", minHeight: "100vh",

      color: "var(--text-primary)", position: "relative"

    }}>

      <FontInjector />



      {/* Ambient gold glow */}

      <div style={{

        position: "fixed", top: "30%", left: "50%", transform: "translate(-50%,-50%)",

        width: 600, height: 600, borderRadius: "50%",

        background: "radial-gradient(circle, rgba(255,215,0,0.025) 0%, transparent 70%)",

        pointerEvents: "none", zIndex: 0

      }} />



      <div style={{ display: "flex", flexDirection: "column", height: "100vh", overflow: "hidden" }}>

        <Header activeTab={activeNavTab} setActiveTab={setActiveNavTab} />

        <div style={{ display: "flex", flex: 1, overflow: "hidden" }}>

          <Sidebar activeItem={activeSideItem} setActiveItem={setActiveSideItem} />



          <div style={{ flex: 1, overflow: "auto", padding: 24 }}>



            {/* Page Header */}

            <div style={{ marginBottom: 28, display: "flex", justifyContent: "space-between", alignItems: "flex-start" }}>

              <div>

                <Breadcrumbs items={["NEXUS", "DASHBOARD", "COMPONENT LAB"]} />

                <h1 style={{

                  fontSize: 22, fontWeight: 700, letterSpacing: "0.18em", textTransform: "uppercase",

                  fontFamily: "var(--font)", marginTop: 8, lineHeight: 1, color: "var(--w-100)"

                }}>TICKETPUNCH UI</h1>

                <div style={{

                  fontSize: 8, letterSpacing: "0.28em", color: "var(--g-700)", textTransform: "uppercase",

                  fontFamily: "var(--font)", marginTop: 6

                }}>

                  DESIGN SYSTEM β€” OMEGA CLASSIFICATION β€” BUILD 2047.03.12

                </div>

              </div>

              <div style={{ display: "flex", gap: 8, alignItems: "center" }}>

                <StatusPill status="active" label="ALL SYSTEMS GO" />

                <Button variant="outline" size="sm">EXPORT</Button>

              </div>

            </div>



            {/* STAT CARDS */}

            <SectionLabel sub="// REAL-TIME METRICS β€” CLASSIFIED">SYSTEM OVERVIEW</SectionLabel>

            <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 12, marginBottom: 28 }}>

              <StatCard label="ACTIVE NODES" value="847" change="+12 TODAY" trend="up" />

              <StatCard label="THREAT LEVEL" value="2.7" unit="%" change="-0.4 DELTA" trend="down" />

              <StatCard label="DATA STREAMS" value="1.4" unit="TB" change="+0.2 TB" trend="up" />

              <StatCard label="UPTIME" value="99.9" unit="%" change="NOMINAL" trend="neutral" />

            </div>



            {/* MAIN TICKET CARD */}

            <SectionLabel sub="// TICKET SHELL β€” PRIMARY CONTAINER">CLASSIFIED INTEL BRIEF</SectionLabel>

            <div style={{ marginBottom: 28 }}>

              <TicketShell stubHeight={68}>

                <div style={{ padding: "28px 24px 80px", position: "relative", zIndex: 8 }}>

                  <div style={{ display: "flex", gap: 20, alignItems: "flex-start" }}>

                    <TerminalMask size={100} />

                    <div style={{ flex: 1 }}>

                      <div style={{

                        fontSize: 7, letterSpacing: "0.34em", color: "var(--g-700)",

                        textTransform: "uppercase", fontFamily: "var(--font)", marginBottom: 6

                      }}>

                        // OMEGA-NEXUS // DIRECTIVE 7749 // CLASSIFIED

                      </div>

                      <h2 style={{

                        fontSize: 18, fontWeight: 700, letterSpacing: "0.18em", textTransform: "uppercase",

                        fontFamily: "var(--font)", marginBottom: 10, lineHeight: 1.2, color: "var(--g-300)"

                      }}>

                        OPERATION<br />BLACKOUT

                      </h2>

                      <p style={{

                        fontSize: 8.5, color: "var(--w-500)", lineHeight: 1.8,

                        letterSpacing: "0.12em", fontFamily: "var(--font)", maxWidth: 420

                      }}>

                        AUTHORIZED PERSONNEL ONLY. MISSION PARAMETERS LOCKED PENDING CLEARANCE VERIFICATION.

                        ALL COMMUNICATION ENCRYPTED VIA NEXUS-PROTOCOL AES-512.

                      </p>

                      <div style={{ marginTop: 14, display: "flex", gap: 8, flexWrap: "wrap" }}>

                        <Badge variant="omega">OMEGA-7</Badge>

                        <Badge variant="danger">TOP SECRET</Badge>

                        <Badge variant="warning">ACTIVE</Badge>

                        <Badge>NEXUS-PROTOCOL</Badge>

                      </div>

                    </div>

                    <div style={{ display: "flex", flexDirection: "column", gap: 10, alignItems: "flex-end" }}>

                      <Barcode value="OP-7749-BX-OMEGA" width={130} height={36} />

                      <Micro color="var(--g-700)">ISSUED: 2047.03.12</Micro>

                    </div>

                  </div>

                </div>

                <div style={{

                  position: "absolute", bottom: 0, left: 0, right: 0, height: 68, padding: "0 24px",

                  display: "flex", alignItems: "center", justifyContent: "space-between", zIndex: 8

                }}>

                  <Micro color="var(--g-700)">REF: NEXUS-OP-7749</Micro>

                  <div style={{ display: "flex", gap: 16 }}>

                    <StatusPill status="active" label="MISSION ACTIVE" />

                    <StatusPill status="warning" label="HIGH RISK" />

                  </div>

                </div>

              </TicketShell>

            </div>



            {/* TABS + TABLE */}

            <SectionLabel sub="// DATA MANAGEMENT INTERFACE">INTEL DATABASE</SectionLabel>

            <div style={{ marginBottom: 28 }}>

              <Card>

                <Tabs tabs={["AGENTS", "MISSIONS", "ASSETS", "THREATS"]} active={activeTab} onSelect={setActiveTab} />

                <div style={{ marginTop: 16 }}>

                  <DataTable

                    columns={["AGENT ID", "STATUS", "CLEARANCE", "ASSIGNMENT", "LAST ACTIVE"]}

                    rows={[

                      ["AGT-001 SPECTRE", <Badge variant="active">ACTIVE</Badge>, "OMEGA", "OP-7749", "0:04:22 AGO"],

                      ["AGT-002 PHANTOM", <Badge variant="warning">STANDBY</Badge>, "DELTA", "OP-7700", "2:14:07 AGO"],

                      ["AGT-003 WRAITH", <Badge variant="danger">COMPROMISED</Badge>, "GAMMA", "β€”", "6:55:13 AGO"],

                      ["AGT-004 NEXUS", <Badge>OFFLINE</Badge>, "ALPHA", "OP-7801", "1D 04H AGO"],

                    ]}

                  />

                </div>

              </Card>

            </div>



            {/* BUTTONS */}

            <SectionLabel sub="// INTERACTION PRIMITIVES">BUTTON SYSTEM</SectionLabel>

            <div style={{ marginBottom: 28 }}>

              <Card title="BUTTON VARIANTS" sub="ALL STATES + SIZES">

                <div style={{ display: "flex", flexWrap: "wrap", gap: 8, marginBottom: 16 }}>

                  <Button variant="primary">EXECUTE</Button>

                  <Button variant="secondary">STANDBY</Button>

                  <Button variant="outline">CONFIRM</Button>

                  <Button variant="ghost">DISMISS</Button>

                  <Button variant="danger">ABORT</Button>

                  <Button variant="success">SECURE</Button>

                  <Button variant="primary" disabled>LOCKED</Button>

                  <Button variant="outline" size="sm">SMALL</Button>

                  <Button variant="primary" size="lg">LAUNCH SEQUENCE</Button>

                  <Tooltip label="OMEGA CLASSIFIED FUNCTION">

                    <Button variant="secondary" icon="β—ˆ">WITH ICON</Button>

                  </Tooltip>

                </div>

                <Divider label="ICON VARIANTS" />

                <div style={{ display: "flex", gap: 8, marginTop: 12 }}>

                  {["β—ˆ", "β—‰", "β–£", "β—†", "βŠ•"].map((icon, i) => (

                    <Button key={i} variant="secondary" size="sm" icon={icon}>{icon === "βŠ•" ? "ADD" : ""}</Button>

                  ))}

                </div>

              </Card>

            </div>



            {/* FORM ELEMENTS */}

            <SectionLabel sub="// DATA ENTRY SYSTEM">FORM ELEMENTS</SectionLabel>

            <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 16, marginBottom: 28 }}>

              <Card title="TEXT INPUTS" sub="TERMINAL STYLE">

                <div style={{ display: "flex", flexDirection: "column", gap: 14 }}>

                  <Input label="AGENT ID" placeholder="ENTER AGENT IDENTIFIER"

                    value={inputVal} onChange={e => setInputVal(e.target.value)} hint="FORMAT: AGT-XXX-CLEARANCE" />

                  <Input label="AUTHORIZATION CODE" placeholder="β€’β€’β€’β€’β€’β€’β€’β€’" type="password" />

                  <Input label="COORDINATES" placeholder="00.000000, 00.000000" prefix="GEO" suffix="WGS84" />

                  <Fieldset legend="COMMS CHANNEL">

                    <Input label="FREQUENCY" placeholder="XXX.XXXXX MHZ" prefix="RF" />

                    <Toggle checked={toggleA} onChange={() => setToggleA(!toggleA)} label="ENCRYPTION ENABLED" />

                  </Fieldset>

                </div>

              </Card>

              <Card title="SELECTORS + TOGGLES" sub="CONTROL ELEMENTS">

                <div style={{ display: "flex", flexDirection: "column", gap: 14 }}>

                  <Select label="CLEARANCE LEVEL" options={["ALPHA", "BETA", "GAMMA", "DELTA", "OMEGA"]}

                    value={selectVal} onChange={setSelectVal} />

                  <Select label="MISSION STATUS" options={["ACTIVE", "STANDBY", "COMPLETED", "ABORT", "CLASSIFIED"]}

                    value="" onChange={() => { }} />

                  <Divider label="TOGGLES" />

                  <Toggle checked={toggleA} onChange={() => setToggleA(!toggleA)} label="ACTIVE SURVEILLANCE" />

                  <Toggle checked={toggleB} onChange={() => setToggleB(!toggleB)} label="STEALTH MODE" />

                  <Toggle checked={true} onChange={() => { }} label="ENCRYPTION LAYER" />

                  <Divider />

                  <div>

                    <Micro color="var(--g-500)">PROGRESS INDICATORS</Micro>

                    <div style={{ marginTop: 10, display: "flex", flexDirection: "column", gap: 10 }}>

                      <ProgressBar value={87} label="UPLINK SYNC" color="var(--g-300)" />

                      <ProgressBar value={44} label="THREAT SCAN" color="var(--p-500)" />

                      <ProgressBar value={12} label="BREACH RISK" color="var(--r-500)" />

                    </div>

                  </div>

                </div>

              </Card>

            </div>



            {/* STATUS + BADGES */}

            <SectionLabel sub="// CLASSIFICATION LABELS">STATUS SYSTEM</SectionLabel>

            <div style={{ marginBottom: 28 }}>

              <Card title="BADGES + STATUS PILLS" sub="ALL VARIANTS">

                <div style={{ display: "flex", flexWrap: "wrap", gap: 8, marginBottom: 16 }}>

                  <StatusPill status="active" />

                  <StatusPill status="inactive" label="OFFLINE" />

                  <StatusPill status="warning" label="STANDBY" />

                  <StatusPill status="danger" label="BREACH" />

                  <StatusPill status="pending" label="SYNCING" />

                </div>

                <Divider label="BADGES" />

                <div style={{ display: "flex", flexWrap: "wrap", gap: 6, marginTop: 12 }}>

                  <Badge variant="omega">OMEGA</Badge>

                  <Badge variant="active">ACTIVE</Badge>

                  <Badge variant="danger">COMPROMISED</Badge>

                  <Badge variant="warning">ALERT</Badge>

                  <Badge>DEFAULT</Badge>

                  <Badge>CLASSIFIED</Badge>

                  <Badge>NEXUS</Badge>

                </div>

              </Card>

            </div>



            {/* ACCORDION + STEPPER */}

            <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 16, marginBottom: 28 }}>

              <div>

                <SectionLabel sub="// COLLAPSIBLE SECTIONS">ACCORDION</SectionLabel>

                <Card>

                  <AccordionItem title="MISSION PARAMETERS">

                    PRIMARY OBJECTIVE: INFILTRATE NEXUS SIGMA NODE. SECONDARY: EXTRACT DATA PACKAGE DELTA-7.

                    ABORT CODE: 4419-OMEGA. DURATION: 72H MAX.

                  </AccordionItem>

                  <AccordionItem title="AGENT DOSSIER">

                    AGENT: SPECTRE-9 // RANK: SENIOR OPERATIVE // CLEARANCE: OMEGA //

                    STATUS: FIELD ACTIVE // DEPLOYMENTS: 47 COMPLETED.

                  </AccordionItem>

                  <AccordionItem title="CLASSIFIED INTEL">

                    [REDACTED β€” CLEARANCE LEVEL OMEGA REQUIRED. CONTACT DIVISION COMMANDER FOR ACCESS CREDENTIALS.]

                  </AccordionItem>

                </Card>

              </div>

              <div>

                <SectionLabel sub="// MISSION PROGRESS WIZARD">STEPPER</SectionLabel>

                <Card>

                  <Stepper steps={["BRIEF", "DEPLOY", "ACTIVE", "EXTRACT", "DEBRIEF"]} current={2} />

                  <div style={{ marginTop: 20 }}>

                    <Divider label="CURRENT PHASE" />

                    <div style={{ marginTop: 12, padding: "12px", border: "1px solid var(--g-900)", position: "relative" }}>

                      <div style={{

                        fontSize: 7, letterSpacing: "0.28em", color: "var(--g-300)",

                        fontFamily: "var(--font)", textTransform: "uppercase", marginBottom: 6

                      }}>β–Ά PHASE 3: ACTIVE DEPLOYMENT</div>

                      <div style={{ fontSize: 8, color: "var(--w-500)", lineHeight: 1.7, letterSpacing: "0.12em", fontFamily: "var(--font)" }}>

                        AGENT SPECTRE-9 IS CURRENTLY ACTIVE IN THE FIELD. ALL VITALS NOMINAL.

                        COMMS ENCRYPTED. ETA TO OBJECTIVE: 04:22:11.

                      </div>

                    </div>

                  </div>

                </Card>

              </div>

            </div>



            {/* ALERTS + LOADER */}

            <SectionLabel sub="// SYSTEM NOTIFICATIONS">ALERTS + LOADERS</SectionLabel>

            <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 16, marginBottom: 28 }}>

              <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>

                <Alert type="success" title="OPERATION SECURED"

                  message="NEXUS NODE ALPHA SECURED. ALL OBJECTIVES COMPLETE. EXTRACTION CONFIRMED." />

                <Alert type="warning" title="SIGNAL INTERFERENCE"

                  message="COMMS DEGRADED ON CHANNEL 7. SWITCHING TO BACKUP FREQUENCY 449.7750 MHZ." />

                <Alert type="danger" title="BREACH DETECTED"

                  message="UNAUTHORIZED ACCESS ATTEMPT β€” NODE SIGMA. LOCKDOWN INITIATED. STANDBY." onClose={() => { }} />

                <Alert type="info" title="ROUTINE SCAN COMPLETE"

                  message="ALL SYSTEMS NOMINAL. NEXT SCHEDULED SWEEP IN 04:00:00." />

              </div>

              <Card title="SYSTEM STATES" sub="LOADING INDICATORS">

                <div style={{ display: "flex", gap: 20, alignItems: "center", justifyContent: "center", padding: 20 }}>

                  {[["SMALL", 28], ["MEDIUM", 44], ["LARGE", 64]].map(([lbl, sz]) => (

                    <div key={lbl} style={{ display: "flex", flexDirection: "column", alignItems: "center", gap: 8 }}>

                      <Spinner size={sz} /><Micro color="var(--g-500)">{lbl}</Micro>

                    </div>

                  ))}

                </div>

                <Divider label="AVATARS" />

                <div style={{ display: "flex", gap: 10, marginTop: 12, alignItems: "center" }}>

                  <Avatar initials="Ξ©" status="active" />

                  <Avatar initials="Ξ£" status="active" />

                  <Avatar initials="Ξ”" />

                  <Avatar initials="Ξ“" />

                  <div style={{ flex: 1 }}>

                    <div style={{ fontSize: 8.5, letterSpacing: "0.16em", fontFamily: "var(--font)", color: "var(--g-300)" }}>OMEGA TEAM</div>

                    <div style={{

                      fontSize: 7, letterSpacing: "0.18em", color: "var(--g-700)", fontFamily: "var(--font)",

                      textTransform: "uppercase", marginTop: 2

                    }}>4 AGENTS // 2 ACTIVE</div>

                  </div>

                </div>

              </Card>

            </div>



            {/* MODAL TRIGGER */}

            <SectionLabel sub="// OVERLAY SYSTEM">MODAL SYSTEM</SectionLabel>

            <div style={{ marginBottom: 28 }}>

              <Card title="MODAL TRIGGER" sub="TICKET-SHELL OVERLAY">

                <div style={{ display: "flex", gap: 8, alignItems: "center" }}>

                  <Button variant="outline" onClick={() => setModalOpen(true)}>OPEN CLASSIFIED BRIEF</Button>

                  <Tooltip label="OPENS A FULL TICKET-SHELL MODAL">

                    <Button variant="ghost" icon="β—ˆ" />

                  </Tooltip>

                </div>

              </Card>

            </div>



            {/* TYPOGRAPHY */}

            <SectionLabel sub="// IBM PLEX MONO TYPE SYSTEM">TYPOGRAPHY</SectionLabel>

            <div style={{ marginBottom: 28 }}>

              <Card title="TYPE SCALE + WEIGHTS">

                <div style={{ display: "flex", flexDirection: "column", gap: 6 }}>

                  {[

                    { size: 22, weight: 700, text: "DISPLAY β€” OMEGA PROTOCOL", color: "var(--g-300)" },

                    { size: 16, weight: 700, text: "H1 β€” CLASSIFIED DIRECTIVE", color: "var(--w-100)" },

                    { size: 13, weight: 600, text: "H2 β€” NEXUS SYSTEM HEADER", color: "var(--w-200)" },

                    { size: 11, weight: 600, text: "H3 β€” OPERATION BRIEFING", color: "var(--w-300)" },

                    { size: 9.5, weight: 500, text: "H4 β€” SUBHEADING ALPHA", color: "var(--w-300)" },

                    { size: 8.5, weight: 400, text: "BODY β€” STANDARD INTEL REPORT BODY TEXT FOR EXTENDED BRIEFINGS", color: "var(--w-400)" },

                    { size: 7.5, weight: 400, text: "SMALL β€” SECONDARY SUPPORT LABELS AND DESCRIPTORS", color: "var(--w-500)" },

                    { size: 7, weight: 400, text: "MICRO β€” OMEGA-7749 // COPYRIGHT NEXUS DIVISION // CLEARANCE REQUIRED", color: "var(--g-700)" },

                  ].map((t, i) => (

                    <div key={i} style={{

                      display: "flex", alignItems: "baseline", gap: 16,

                      borderBottom: i < 7 ? "1px solid var(--border-1)" : "none", paddingBottom: 6

                    }}>

                      <span style={{ fontSize: 7, color: "var(--g-700)", width: 28, fontFamily: "var(--font)", letterSpacing: "0.1em" }}>{t.size}PX</span>

                      <span style={{

                        fontSize: t.size, fontWeight: t.weight, letterSpacing: "0.14em",

                        textTransform: "uppercase", fontFamily: "var(--font)", color: t.color

                      }}>{t.text}</span>

                    </div>

                  ))}

                </div>

              </Card>

            </div>



            {/* COLOR PALETTE */}

            <SectionLabel sub="// DESIGN TOKENS β€” COLOR SYSTEM">COLOR PALETTE</SectionLabel>

            <div style={{ marginBottom: 28 }}>

              <Card title="TOKEN PALETTE" sub="TICKETPUNCH DESIGN LANGUAGE">

                <div style={{ display: "grid", gridTemplateColumns: "repeat(5, 1fr)", gap: 8 }}>

                  {[

                    { scheme: "DARK", name: "D-900", val: "#060606" },

                    { scheme: "DARK", name: "D-800", val: "#0A0A0A" },

                    { scheme: "DARK", name: "D-700", val: "#0f0f0f" },

                    { scheme: "DARK", name: "D-600", val: "#1e1e1e" },

                    { scheme: "DARK", name: "D-500", val: "#2a2a2a" },

                    { scheme: "WHITE", name: "W-100", val: "#FFFFFF" },

                    { scheme: "WHITE", name: "W-200", val: "#EFEFEF" },

                    { scheme: "WHITE", name: "W-300", val: "#CDCDCD" },

                    { scheme: "WHITE", name: "W-400", val: "#AAAAAA" },

                    { scheme: "WHITE", name: "W-500", val: "#888888" },

                    { scheme: "GOLD", name: "G-100", val: "#FFF4CC" },

                    { scheme: "GOLD", name: "G-300", val: "#FFD700" },

                    { scheme: "GOLD", name: "G-500", val: "#C8960C" },

                    { scheme: "GOLD", name: "G-700", val: "#7A5800" },

                    { scheme: "GOLD", name: "G-900", val: "#3D2C00" },

                    { scheme: "RED", name: "R-100", val: "#FFE5E5" },

                    { scheme: "RED", name: "R-300", val: "#FF6666" },

                    { scheme: "RED", name: "R-500", val: "#FF3333" },

                    { scheme: "RED", name: "R-700", val: "#CC0000" },

                    { scheme: "RED", name: "R-900", val: "#550000" },

                    { scheme: "PEACH", name: "P-100", val: "#FFF0EB" },

                    { scheme: "PEACH", name: "P-300", val: "#FFBFA8" },

                    { scheme: "PEACH", name: "P-500", val: "#FF8C69" },

                    { scheme: "PEACH", name: "P-700", val: "#C45A35" },

                    { scheme: "PEACH", name: "P-900", val: "#5C2010" },

                  ].map((c, i) => (

                    <div key={i} style={{ display: "flex", flexDirection: "column", gap: 4 }}>

                      {i % 5 === 0 && (

                        <div style={{

                          fontSize: 6.5, letterSpacing: "0.22em", color: "var(--w-400)",

                          fontFamily: "var(--font)", textTransform: "uppercase", marginBottom: 2, fontWeight: 600

                        }}>{c.scheme}</div>

                      )}

                      {i % 5 !== 0 && <div style={{ height: 15 }} />}

                      <div style={{

                        height: 32, background: c.val, border: "1px solid var(--border-1)",

                        boxShadow: ["GOLD", "RED", "PEACH"].includes(c.scheme) ? `0 0 10px ${c.val}55` : "none"

                      }} />

                      <div style={{

                        fontSize: 6.5, letterSpacing: "0.18em", color: "var(--w-500)",

                        fontFamily: "var(--font)", textTransform: "uppercase"

                      }}>{c.name}</div>

                      <div style={{ fontSize: 6, letterSpacing: "0.12em", color: "var(--g-700)", fontFamily: "var(--font)" }}>{c.val}</div>

                    </div>

                  ))}

                </div>

              </Card>

            </div>



            {/* PRIMITIVES */}

            <SectionLabel sub="// CORE VISUAL PRIMITIVES">DESIGN PRIMITIVES</SectionLabel>

            <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16, marginBottom: 28 }}>

              <Card title="GRAIN OVERLAY" sub="STATIC NOISE TEXTURE" style={{ minHeight: 120 }}>

                <div style={{ display: "flex", flexDirection: "column", gap: 6 }}>

                  {[0.08, 0.18, 0.28].map((s, i) => (

                    <div key={i} style={{ position: "relative", height: 28, background: "var(--header)", border: "1px solid var(--border-1)" }}>

                      <GrainOverlay strength={s} />

                      <div style={{ position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", zIndex: 7 }}>

                        <Micro color="var(--g-500)">{(s * 100).toFixed(0)}% STRENGTH</Micro>

                      </div>

                    </div>

                  ))}

                </div>

              </Card>

              <Card title="BARCODES" sub="GENERATIVE PATTERN">

                <div style={{ display: "flex", flexDirection: "column", gap: 10 }}>

                  <Barcode value="OMEGA-7749-XX" width={160} height={32} />

                  <Barcode value="NEXUS-ALPHA-01" width={160} height={20} />

                  <Barcode value="CLASSIFIED" width={160} height={14} />

                </div>

              </Card>

              <Card title="TERMINAL MASK" sub="SCROLLING INTEL FEED">

                <div style={{ display: "flex", gap: 12, justifyContent: "center" }}>

                  <TerminalMask size={90} /><TerminalMask size={70} />

                </div>

              </Card>

            </div>



            <Footer />

          </div>

        </div>

      </div>



      <Modal open={modalOpen} onClose={() => setModalOpen(false)} title="CLASSIFIED DIRECTIVE">

        <p style={{ marginBottom: 12 }}>

          THIS DOCUMENT CONTAINS INFORMATION OF THE HIGHEST CLASSIFICATION.

          UNAUTHORIZED DISCLOSURE IS A VIOLATION OF NEXUS PROTOCOL ARTICLE 7-OMEGA.

        </p>

        <p>

          OPERATION BLACKOUT IS AUTHORIZED BY DIVISION COMMANDER NEXUS-1.

          ALL AGENTS MUST CONFIRM RECEIPT VIA SECURE CHANNEL BEFORE DEPLOYMENT.

        </p>

        <div style={{ marginTop: 16 }}>

          <Barcode value="DIRECTIVE-4419-OMEGA" width={160} height={24} />

        </div>

      </Modal>

    </div>
  );
}