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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6cd6e0c
d80907b
 
 
579285c
d80907b
ee9474e
579285c
 
 
d80907b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ee9474e
d80907b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6cd6e0c
d80907b
 
 
 
 
 
 
 
 
 
6cd6e0c
d80907b
 
 
 
 
 
 
 
 
 
6cd6e0c
d80907b
 
ee9474e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/* ─────────────────────────────────────────────────────────────
 * platform.css — YAZ Platform Base Styles
 * Migrated from shared/base.html inline <style> block
 * Includes: token aliases, dark-mode overrides, layout, sidebar, nav
 * ─────────────────────────────────────────────────────────── */
:root {
            /* Aliases not in tokens.css */
            --accent: var(--c-neutral-900);
            --accent-hover: var(--c-neutral-700);
            --primary-light: var(--primary-subtle);

            /* Shadow shortcut */
            --shadow: var(--shadow-sm);

            /* Radius backward-compat (tokens uses --radius-sm/md/lg) */
            --radius: 6px;

            /* Layout */
            --sidebar-width: var(--sidebar-w);
            --header-height: var(--header-h);
            --bottom-nav-height: var(--bottomnav-h);

            /* Transition backward-compat (tokens uses --transition-fast/--transition) */
            --transition-fast: 0.08s ease;

            /* Focus ring (simple rgba for older components) */
            --focus-ring: rgba(92, 107, 192, 0.25);
        }

        [data-theme="dark"] {
            --accent: var(--c-neutral-50);
            --accent-hover: var(--c-neutral-200);
            --shadow: var(--shadow-sm);
            --focus-ring: rgba(139, 154, 216, 0.3);
        }

        /* Dark mode overrides for hard-coded Tailwind classes used by older templates */
        [data-theme="dark"] .bg-white { background-color: var(--surface) !important; }
        [data-theme="dark"] .bg-gray-50,
        [data-theme="dark"] .bg-gray-100 { background-color: var(--bg) !important; }
        [data-theme="dark"] .bg-gray-200 { background-color: var(--border) !important; }
        [data-theme="dark"] .text-gray-900,
        [data-theme="dark"] .text-black { color: var(--text) !important; }
        [data-theme="dark"] .text-gray-700,
        [data-theme="dark"] .text-gray-600 { color: var(--text-muted) !important; }
        [data-theme="dark"] .text-gray-500,
        [data-theme="dark"] .text-gray-400 { color: var(--text-muted) !important; }
        [data-theme="dark"] .border-gray-200,
        [data-theme="dark"] .border-gray-300 { border-color: var(--border) !important; }
        [data-theme="dark"] .shadow-sm { box-shadow: var(--shadow-sm) !important; }
        [data-theme="dark"] .shadow { box-shadow: var(--shadow-md) !important; }

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

        *:focus { outline: none; }
        *:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        /* Skip-to-content link (screen reader + keyboard users) */
        .skip-link {
            position: absolute;
            top: -100%;
            left: 0;
            padding: 0.625rem 1.25rem;
            background: var(--primary);
            color: #fff;
            font-size: 0.875rem;
            font-weight: 600;
            border-radius: 0 0 0.5rem 0;
            z-index: 9999;
            text-decoration: none;
            transition: top 0.1s;
        }
        .skip-link:focus {
            top: 0;
            outline: 3px solid #fff;
            outline-offset: 2px;
        }

        /* Dropdown app links - no transition, fixed size, instant hover */
        .dropdown-app-link {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 10px 8px;
            border-radius: 8px;
            text-decoration: none;
            color: var(--text);
            height: 60px;
            min-height: 60px;
        }
        .dropdown-app-link:hover {
            background: var(--surface);
        }
        .dropdown-app-link i,
        .dropdown-app-link img,
        .dropdown-app-link svg {
            flex-shrink: 0;
        }

        body {
            font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background-color: var(--bg);
            color: var(--text);
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            /* Let browser synthesise bold from 600 (we only serve 400/500/600) */
            font-synthesis: weight;
        }

        .menu-btn:hover {
            background: var(--surface);
        }

        /* Icon button styling matching index.html */
        .icon-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            cursor: pointer;
            color: var(--text);
            border-radius: 8px;
            /* Specific props only — avoids layout recalc on every transition */
            transition: background var(--transition-fast), color var(--transition-fast);
        }

        .icon-btn:hover {
            background: var(--surface);
        }

        .icon-btn.has-badge {
            position: relative;
        }

        .icon-btn.has-badge::after {
            content: '';
            position: absolute;
            top: 8px;
            right: 8px;
            width: 8px;
            height: 8px;
            background: #ef4444;
            border-radius: 50%;
            border: 2px solid var(--bg);
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--accent);
            color: var(--bg);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }

        /* Layout container */
        .layout {
            display: flex;
            flex: 1;
            overflow: hidden;
            min-height: 0;
            max-width: 100%;
            width: 100%;
        }

        /* Sidebar - Fixed position (always expanded) */
        .sidebar {
            position: fixed;
            top: var(--header-height);
            left: 0;
            height: calc(100vh - var(--header-height));
            width: var(--sidebar-width);
            background: var(--bg);
            border-right: 1px solid var(--border-subtle);
            overflow-y: auto;
            overflow-x: hidden;
            padding: 32px 0 10px;
            flex-shrink: 0;
            z-index: var(--z-sidebar, 90);
            contain: layout style;
        }

        .sidebar .nav-item span {
            opacity: 1;
            width: auto;
            white-space: nowrap;
        }

        .sidebar .nav-group-title {
            opacity: 1;
            visibility: visible;
            padding: 10px 14px 4px;
        }

        .sidebar-nav {
            flex: 1;
            padding: 0 0 0.25rem !important;
            overflow-y: auto;
        }

        .nav-group {
            margin-bottom: 6px;
        }

        .nav-group-title {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 10px;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 14.5px;
            font-weight: 500;
            cursor: pointer;
            margin: 1px 6px;
            border-radius: 7px;
            justify-content: flex-start;
            transition: background 100ms ease, color 100ms ease;
        }

        .nav-item:hover {
            background: var(--surface-hover);
            color: var(--text);
        }

        .nav-item.active {
            color: var(--text);
            background: var(--surface);
            font-weight: 600;
        }

        [data-theme="dark"] .nav-item.active {
            background: var(--surface-raised);
        }

        .nav-item svg,
        .nav-item i {
            width: 16px;
            height: 16px;
            font-size: 15px;
            flex-shrink: 0;
            stroke-width: 1.75;
            opacity: 0.6;
            transition: opacity 100ms ease;
        }

        .nav-item:hover svg,
        .nav-item:hover i,
        .nav-item.active svg,
        .nav-item.active i {
            opacity: 1;
        }

        /* Collapsible nav groups */
        .nav-group-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            padding: 10px 14px 4px;
            border: none;
            background: none;
            cursor: pointer;
            user-select: none;
        }
        .nav-group-toggle .nav-group-title { padding: 0; }
        .nav-group-chevron {
            width: 12px; height: 12px;
            color: var(--text-muted);
            opacity: 0.5;
            flex-shrink: 0;
            transition: transform 0.2s ease, opacity 0.15s ease;
        }
        .nav-group-toggle:hover .nav-group-chevron { opacity: 0.9; }
        .nav-group-collapsible .nav-group-items {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.2s ease;
        }
        .nav-group-collapsible.open .nav-group-items { max-height: 500px; }
        .nav-group-collapsible.open .nav-group-chevron { transform: rotate(90deg); }

        /* Main Content - adjusted for fixed sidebar */
        main {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 1.35rem 2rem;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            min-width: 0;
            margin-left: var(--sidebar-width);
            width: calc(100% - var(--sidebar-width));
            content-visibility: auto;
            contain-intrinsic-block-size: 800px;
        }

        /* Header Brand — single typography system for platform + apps */
        :root {
            --brand-font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --brand-font-size: 18px;
            --brand-font-weight: 800;
            --brand-letter-spacing: 0.22em;
        }

        .header-brand {
            display: flex;
            align-items: center;
            font-family: var(--brand-font-family);
            font-weight: var(--brand-font-weight);
            font-size: var(--brand-font-size);
            letter-spacing: var(--brand-letter-spacing);
            line-height: 1;
            text-transform: uppercase;
            background: linear-gradient(135deg, var(--c-primary-500) 0%, var(--c-primary-700) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-decoration: none;
            padding: 0 10px;
            flex-shrink: 0;
            min-width: max-content;   /* never allow the brand to be narrowed below its natural width */
            white-space: nowrap;      /* prevents letter-wrap at very small containers */
            transition: opacity 0.1s ease;
        }
        #main-header {
            transition: background-color 0.1s ease, border-color 0.1s ease;
        }
        .header-brand.is-switching {
            opacity: 0.7;
        }
        [data-theme="dark"] .header-brand {
            background: linear-gradient(135deg, var(--c-primary-300) 0%, var(--c-primary-500) 100%);
            -webkit-background-clip: text;
            background-clip: text;
        }
        .header-brand:hover {
            opacity: 0.8;
        }

        /* ── App context brand: "← YAZ / AppName" ──────────────────────
           Used by app_base.html when navigating into a domain engine.
           The "YAZ" back-link is muted; the app name gets full gradient treatment.
        ────────────────────────────────────────────────────────────────── */
        .header-brand-back {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            font-weight: 600;
            font-size: 13px;
            color: var(--text-muted);
            text-decoration: none;
            flex-shrink: 0;
            padding: 0 2px;
            transition: color var(--transition-fast);
        }
        .header-brand-back:hover { color: var(--text); text-decoration: none; }
        .header-brand-back-icon { opacity: 0.6; flex-shrink: 0; }

        .header-brand-sep {
            color: var(--border);
            font-size: 15px;
            font-weight: 300;
            margin: 0 2px;
            flex-shrink: 0;
            user-select: none;
        }

        /* App-specific brand: identical weight/size/spacing as the YAZ platform brand.
           Only the gradient colour differs (set via inline style per app). */
        .header-brand--app {
            font-family: var(--brand-font-family);
            font-weight: var(--brand-font-weight);
            font-size: var(--brand-font-size);
            letter-spacing: var(--brand-letter-spacing);
            line-height: 1;
            text-transform: uppercase;
        }

        /* ── App-scoped search input in nav bar ─────────────────────────
           Replaces the command-palette trigger when an app injects its
           own search (e.g., Surgio bloc case search).
        ────────────────────────────────────────────────────────────────── */
        .nav-search-app-input {
            height: 32px;
            padding: 0 0.875rem 0 2.25rem;
            font-size: 0.875rem;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: var(--bg);
            color: var(--text);
            outline: none;
            width: clamp(180px, 26vw, 380px);
            transition: border-color 0.15s, box-shadow 0.15s, width 0.2s ease;
        }
        .nav-search-app-input::placeholder { color: var(--text-muted); }
        .nav-search-app-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
            width: clamp(200px, 32vw, 460px);
        }
        .nav-search-app-input:focus-visible { outline: none; }

        /* Screen-reader only utility */
        .sr-only {
            position: absolute; width: 1px; height: 1px; padding: 0;
            margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
            white-space: nowrap; border-width: 0;
        }

        /* Tablet: narrow sidebar with icons only */
        @media (min-width: 769px) and (max-width: 900px) {
            :root { --sidebar-width: 56px; }
            .sidebar .nav-item span { display: none; }
            .sidebar .nav-group-title { display: none; }
            .sidebar .nav-group-toggle { justify-content: center; padding: 8px; }
            .sidebar .nav-group-chevron { display: none; }
            .sidebar .nav-group-collapsible .nav-group-items { max-height: 500px; }
            .sidebar .nav-item { justify-content: center; padding: 8px; margin: 1px 4px; }
        }

        /* Hide sidebar on mobile, show bottom nav */
        @media (max-width: 768px) {
            .sidebar {
                display: none;
            }

            /* Mobile main: full width, pad for bottom nav */
            main {
                margin-left: 0;
                width: 100%;
                padding: 1.1rem 1rem;
                padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 1.5rem) !important;
            }

        /* Compact brand on mobile — never shrink or wrap */
            .header-brand {
                font-size: var(--brand-font-size);
                flex-shrink: 0;
                min-width: max-content;
                white-space: nowrap;
            }
        }

        /* Sidebar scrollbar */
        .sidebar::-webkit-scrollbar {
            width: 4px;
        }
        .sidebar::-webkit-scrollbar-track {
            background: transparent;
        }
        .sidebar::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 2px;
        }

        /* Navigation progress bar */
        #nav-progress {
            position: fixed;
            top: 0;
            left: 0;
            height: 2px;
            width: 0;
            background: var(--primary);
            z-index: 9999;
            pointer-events: none;
        }

        /* Content entrance — only via .yaz-page-entering (HTMX nav) to avoid double-fade */
        @keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

        /* Accessibility: honour reduced-motion preferences */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* Mobile: remove 300ms tap delay on interactive elements */
        a, button, [role="button"], input, select, textarea { touch-action: manipulation; }

        /* ── Wide screen (≥1280px) — wider sidebar, breathing room ── */
        @media (min-width: 1280px) {
            :root { --sidebar-width: 240px; }
            .sidebar { width: 240px; }
            main {
                margin-left: 240px;
                width: calc(100% - 240px);
                padding: 1.5rem 2.5rem;
            }
        }

        /* ── Large screen (≥1440px) ── */
        @media (min-width: 1440px) {
            :root { --sidebar-width: 260px; }
            .sidebar { width: 260px; }
            main {
                margin-left: 260px;
                width: calc(100% - 260px);
                padding: 1.75rem 3rem;
            }
        }

        /* ── XL screen (≥1920px) ── */
        @media (min-width: 1920px) {
            :root { --sidebar-width: 280px; }
            .sidebar { width: 280px; }
            main {
                margin-left: 280px;
                width: calc(100% - 280px);
                padding: 2.25rem 4rem;
            }
        }

/* ══════════════════════════════════════════════════════════════
   Page Navigation Transitions (Platform ↔ App ↔ App)
   ══════════════════════════════════════════════════════════════

   HTMX hx-boost replaces #main-content (outerHTML). Each app's
   CSS lives inside #main-content via {% block app_styles %} so
   it swaps in/out with the content — no full reload needed.

   Two paths:
   1. View Transitions API (Chrome 111+, Safari 18+):
      htmx-config.js wraps the swap; browser handles old→new.
   2. Fallback (other browsers): .yaz-page-entering class added
      by htmx-config.js on htmx:afterSettle.
   ══════════════════════════════════════════════════════════════ */

/* Give #main-content layout containment; will-change only activates during the
   animation via the .yaz-page-entering class to avoid permanent compositor layer */
#main-content {
    contain: paint style layout;
    /* Chrome 111+ / Safari 18+: scope VT to content area only (header+sidebar stay static) */
    view-transition-name: main-content;
}

/* ── View Transitions API — native browser compositing (Chrome 111+, Safari 18+) ── */
@keyframes vt-fade-out { to   { opacity: 0; } }
@keyframes vt-slide-up { from { opacity: 0; transform: translateY(5px); } }

::view-transition-old(main-content) {
    animation: 50ms ease-in vt-fade-out;
}
::view-transition-new(main-content) {
    animation: 80ms cubic-bezier(0.16, 1, 0.3, 1) vt-slide-up;
}

/* ── CSS fallback (non-VT browsers) — .yaz-page-entering added by htmx-config.js ── */
@keyframes vt-slide-in  {
    from { opacity: 0; transform: translate3d(0, 4px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0);   }
}

#main-content.yaz-page-entering {
    animation: vt-slide-in 60ms cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: opacity, transform;
}

/* ── Reduced motion — cut all transition animations ─────────── */
@media (prefers-reduced-motion: reduce) {
    #main-content.yaz-page-entering { animation: none !important; }
    ::view-transition-old(main-content),
    ::view-transition-new(main-content) { animation: none !important; }
}