/* ==========================================================================
   Sunflower2 — Glassmorphic Frosted-Glass Design Tokens
   Light Mode: Sunlit Golden Meadow with Splashes of Blue Sky
   Dark Mode:  Deep Dark Forest Greens with Occasional Canopy Sunlight
   Pure GPU-composited slow motion · Optical glass reflections · High contrast
   ========================================================================== */

:root {
    color-scheme: light dark;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;

    /* Light Mode — Golden Meadow & Clear Blue Sky */
    --bg-base: #f5f3e8;
    --bg-canvas: linear-gradient(155deg, #e7f3fb 0%, #f7f4e6 46%, #edf3e5 100%);

    /* Translucent Frosted Glass + Specular Reflection Layers (Light) */
    --glass-bg: rgba(255, 255, 255, 0.38);
    --glass-bg-hover: rgba(255, 255, 255, 0.52);
    --topbar-bg-scrolled: rgba(255, 255, 255, 0.78);
    --topbar-veil: linear-gradient(
        to bottom,
        rgba(242, 244, 238, 0.95) 0%,
        rgba(244, 243, 234, 0.86) 56%,
        rgba(245, 243, 232, 0.44) 82%,
        rgba(245, 243, 232, 0) 100%
    );
    --glass-sheen: linear-gradient(
        132deg,
        rgba(255, 255, 255, 0.58) 0%,
        rgba(255, 255, 255, 0.16) 26%,
        rgba(255, 255, 255, 0.02) 52%,
        rgba(255, 250, 232, 0.18) 84%,
        rgba(255, 255, 255, 0.38) 100%
    );
    --glass-glint: linear-gradient(
        118deg,
        transparent 18%,
        rgba(255, 255, 255, 0.45) 32%,
        rgba(255, 255, 255, 0.08) 42%,
        transparent 58%
    );
    --glass-border: rgba(255, 255, 255, 0.62);
    --glass-border-outer: rgba(88, 98, 86, 0.14);
    --glass-highlight-top: rgba(255, 255, 255, 0.88);
    --glass-highlight-bottom: rgba(255, 255, 255, 0.24);
    --glass-shadow:
        0 18px 42px -18px rgba(42, 56, 44, 0.16),
        0 4px 12px -4px rgba(42, 56, 44, 0.08),
        0 0 0 1px var(--glass-border-outer);
    --subtile-bg: rgba(128, 148, 136, 0.08);
    --subtile-bg-hover: rgba(128, 148, 136, 0.13);
    --subtile-border: rgba(88, 98, 86, 0.16);
    --subtile-highlight: rgba(255, 255, 255, 0.56);
    --option-nested-bg: rgba(255, 255, 255, 0.34);
    --project-tint-start: 10%;
    --project-tint-end: 3.5%;
    --project-tint-border: 24%;
    --project-tint-highlight: 12%;

    /* Light Mode Text (WCAG AA+ over translucent meadow/sky glass) */
    --text-primary: #17231e;
    --text-secondary: #3c4d45;
    --text-muted: #495a52;
    --text-note: #26342e;

    /* Accents (Meadow Gold, Sky Blue, Clover Green) */
    --accent-sun: #b87708;
    --accent-sun-soft: rgba(236, 177, 48, 0.22);
    --accent-sage: #237455;
    --accent-sage-soft: rgba(45, 140, 102, 0.18);
    --accent-amber: #2271ad;
    --accent-amber-soft: rgba(65, 152, 224, 0.20);
    --featured-border: rgba(226, 169, 44, 0.55);

    /* Status */
    --status-ok: #1b704c;
    --status-ok-bg: rgba(31, 138, 92, 0.16);
    --status-warn: #ad5512;
    --status-warn-bg: rgba(196, 100, 26, 0.16);

    /* Ambient Light Orbs — Golden Meadow + Splashes of Blue Sky (8-stop eased oklab) */
    --orb-primary: radial-gradient(circle in oklab, rgba(249, 200, 74, 0.68) 0%, rgba(248, 204, 86, 0.56) 14%, rgba(247, 209, 102, 0.39) 28%, rgba(246, 214, 120, 0.22) 42%, rgba(247, 218, 134, 0.10) 56%, rgba(248, 222, 148, 0.035) 70%, rgba(249, 224, 156, 0.008) 84%, rgba(249, 224, 156, 0) 100%);
    --orb-secondary: radial-gradient(circle in oklab, rgba(98, 182, 248, 0.62) 0%, rgba(112, 190, 250, 0.50) 14%, rgba(128, 198, 251, 0.34) 28%, rgba(142, 206, 252, 0.19) 42%, rgba(154, 212, 252, 0.085) 56%, rgba(164, 218, 253, 0.03) 70%, rgba(172, 222, 254, 0.006) 84%, rgba(172, 222, 254, 0) 100%);
    --orb-accent: radial-gradient(circle in oklab, rgba(146, 206, 122, 0.50) 0%, rgba(158, 212, 132, 0.40) 14%, rgba(170, 218, 142, 0.27) 28%, rgba(180, 222, 152, 0.15) 42%, rgba(188, 226, 160, 0.068) 56%, rgba(194, 230, 168, 0.022) 70%, rgba(198, 232, 174, 0.005) 84%, rgba(198, 232, 174, 0) 100%);
    --orb-dapple: radial-gradient(circle in oklab, rgba(255, 224, 122, 0.56) 0%, rgba(242, 218, 148, 0.44) 14%, rgba(212, 214, 182, 0.29) 28%, rgba(168, 206, 224, 0.16) 42%, rgba(146, 202, 242, 0.07) 56%, rgba(140, 200, 246, 0.024) 70%, rgba(140, 200, 246, 0.005) 84%, rgba(140, 200, 246, 0) 100%);
    --canopy-ray: linear-gradient(125deg in oklab, transparent 14%, rgba(255, 244, 196, 0.04) 24%, rgba(255, 244, 196, 0.16) 34%, rgba(255, 244, 196, 0.28) 43%, rgba(210, 229, 230, 0.22) 51%, rgba(148, 209, 255, 0.14) 59%, rgba(148, 209, 255, 0.04) 68%, transparent 78%);
    --canopy-ray-peak: 0.65;
    --dapple-peak: 0.88;
    --texture-opacity: 0.022;

    /* Tooltip */
    --tooltip-bg: rgba(22, 34, 29, 0.94);
    --tooltip-text: #f6faf7;
    --tooltip-warn: #f6b26b;

    /* Spacing & Radius */
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-pill: 999px;
}

/* Dark Mode — Deep Dark Forest Greens with Sunlight Peeking Through the Canopy */
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        --bg-base: #040806;
        --bg-canvas: linear-gradient(155deg, #020503 0%, #050d08 50%, #030906 100%);

        --glass-bg: rgba(9, 17, 13, 0.48);
        --glass-bg-hover: rgba(14, 26, 20, 0.58);
        --topbar-bg-scrolled: rgba(10, 20, 15, 0.84);
        --topbar-veil: linear-gradient(
            to bottom,
            rgba(4, 9, 6, 0.96) 0%,
            rgba(5, 11, 8, 0.88) 56%,
            rgba(5, 11, 8, 0.46) 82%,
            rgba(5, 11, 8, 0) 100%
        );
        --glass-sheen: linear-gradient(
            132deg,
            rgba(205, 245, 220, 0.14) 0%,
            rgba(165, 222, 188, 0.05) 26%,
            rgba(10, 22, 16, 0.02) 55%,
            rgba(238, 204, 110, 0.07) 85%,
            rgba(190, 236, 206, 0.12) 100%
        );
        --glass-glint: linear-gradient(
            118deg,
            transparent 16%,
            rgba(225, 248, 228, 0.14) 30%,
            rgba(244, 214, 126, 0.07) 40%,
            transparent 56%
        );
        --glass-border: rgba(178, 226, 194, 0.18);
        --glass-border-outer: rgba(0, 0, 0, 0.35);
        --glass-highlight-top: rgba(218, 248, 226, 0.24);
        --glass-highlight-bottom: rgba(110, 178, 136, 0.10);
        --glass-shadow:
            0 22px 48px -16px rgba(0, 0, 0, 0.68),
            0 6px 18px -6px rgba(2, 12, 7, 0.52),
            0 0 0 1px var(--glass-border-outer);
        --subtile-bg: rgba(128, 148, 136, 0.08);
        --subtile-bg-hover: rgba(148, 184, 162, 0.13);
        --subtile-border: rgba(178, 226, 194, 0.18);
        --subtile-highlight: rgba(218, 248, 226, 0.09);
        --option-nested-bg: rgba(6, 12, 9, 0.36);
        --project-tint-start: 14%;
        --project-tint-end: 5%;
        --project-tint-border: 30%;
        --project-tint-highlight: 18%;

        --text-primary: #ecf4ee;
        --text-secondary: #b4c8bb;
        --text-muted: #94ac9e;
        --text-note: #d5e2d9;

        --accent-sun: #edc15e;
        --accent-sun-soft: rgba(237, 193, 94, 0.18);
        --accent-sage: #69cf9c;
        --accent-sage-soft: rgba(74, 184, 128, 0.18);
        --accent-amber: #97d48c;
        --accent-amber-soft: rgba(124, 196, 114, 0.18);
        --featured-border: rgba(237, 193, 94, 0.34);

        --status-ok: #68d19b;
        --status-ok-bg: rgba(70, 180, 124, 0.18);
        --status-warn: #f0b15e;
        --status-warn-bg: rgba(236, 166, 72, 0.18);

        /* Deep Pine/Moss Forest Canopy + Occasional Golden Canopy Sunbeams (8-stop eased oklab) */
        --orb-primary: radial-gradient(circle in oklab, rgba(18, 92, 56, 0.46) 0%, rgba(16, 84, 51, 0.37) 10%, rgba(14, 74, 45, 0.25) 21%, rgba(12, 62, 38, 0.14) 32%, rgba(10, 52, 32, 0.065) 43%, rgba(9, 44, 27, 0.022) 53%, rgba(8, 38, 24, 0.005) 62%, rgba(8, 38, 24, 0) 70%);
        --orb-secondary: radial-gradient(circle in oklab, rgba(34, 114, 68, 0.34) 0%, rgba(28, 100, 60, 0.27) 10%, rgba(22, 86, 52, 0.18) 21%, rgba(16, 70, 42, 0.10) 32%, rgba(13, 56, 34, 0.045) 43%, rgba(11, 46, 28, 0.015) 53%, rgba(10, 40, 24, 0.004) 62%, rgba(10, 40, 24, 0) 70%);
        --orb-accent: radial-gradient(circle in oklab, rgba(12, 68, 58, 0.36) 0%, rgba(11, 60, 52, 0.28) 10%, rgba(10, 52, 45, 0.19) 21%, rgba(8, 44, 38, 0.105) 32%, rgba(7, 36, 31, 0.048) 43%, rgba(6, 30, 26, 0.016) 53%, rgba(6, 28, 24, 0.004) 62%, rgba(6, 28, 24, 0) 70%);
        --orb-dapple: radial-gradient(circle in oklab, rgba(236, 198, 92, 0.30) 0%, rgba(214, 192, 88, 0.23) 9%, rgba(186, 182, 82, 0.15) 19%, rgba(154, 170, 78, 0.082) 30%, rgba(122, 146, 72, 0.036) 40%, rgba(92, 116, 62, 0.012) 50%, rgba(72, 92, 54, 0.003) 58%, rgba(72, 92, 54, 0) 65%);
        --canopy-ray: linear-gradient(128deg in oklab, transparent 18%, rgba(240, 206, 108, 0.02) 26%, rgba(240, 206, 108, 0.075) 34%, rgba(240, 206, 108, 0.13) 42%, rgba(188, 194, 104, 0.10) 49%, rgba(116, 176, 98, 0.055) 56%, rgba(116, 176, 98, 0.015) 63%, transparent 70%);
        --canopy-ray-peak: 0.72;
        --dapple-peak: 0.65;
        --texture-opacity: 0.036;

        --tooltip-bg: rgba(232, 244, 236, 0.96);
        --tooltip-text: #0a1610;
        --tooltip-warn: #8c3d04;
    }
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg-base: #040806;
    --bg-canvas: linear-gradient(155deg, #020503 0%, #050d08 50%, #030906 100%);

    --glass-bg: rgba(9, 17, 13, 0.48);
    --glass-bg-hover: rgba(14, 26, 20, 0.58);
    --topbar-bg-scrolled: rgba(10, 20, 15, 0.84);
    --topbar-veil: linear-gradient(
        to bottom,
        rgba(4, 9, 6, 0.96) 0%,
        rgba(5, 11, 8, 0.88) 56%,
        rgba(5, 11, 8, 0.46) 82%,
        rgba(5, 11, 8, 0) 100%
    );
    --glass-sheen: linear-gradient(
        132deg,
        rgba(205, 245, 220, 0.14) 0%,
        rgba(165, 222, 188, 0.05) 26%,
        rgba(10, 22, 16, 0.02) 55%,
        rgba(238, 204, 110, 0.07) 85%,
        rgba(190, 236, 206, 0.12) 100%
    );
    --glass-glint: linear-gradient(
        118deg,
        transparent 16%,
        rgba(225, 248, 228, 0.14) 30%,
        rgba(244, 214, 126, 0.07) 40%,
        transparent 56%
    );
    --glass-border: rgba(178, 226, 194, 0.18);
    --glass-border-outer: rgba(0, 0, 0, 0.35);
    --glass-highlight-top: rgba(218, 248, 226, 0.24);
    --glass-highlight-bottom: rgba(110, 178, 136, 0.10);
    --glass-shadow:
        0 22px 48px -16px rgba(0, 0, 0, 0.68),
        0 6px 18px -6px rgba(2, 12, 7, 0.52),
        0 0 0 1px var(--glass-border-outer);
    --subtile-bg: rgba(128, 148, 136, 0.08);
    --subtile-bg-hover: rgba(148, 184, 162, 0.13);
    --subtile-border: rgba(178, 226, 194, 0.18);
    --subtile-highlight: rgba(218, 248, 226, 0.09);
    --option-nested-bg: rgba(6, 12, 9, 0.36);
    --project-tint-start: 14%;
    --project-tint-end: 5%;
    --project-tint-border: 30%;
    --project-tint-highlight: 18%;

    --text-primary: #ecf4ee;
    --text-secondary: #b4c8bb;
    --text-muted: #94ac9e;
    --text-note: #d5e2d9;

    --accent-sun: #edc15e;
    --accent-sun-soft: rgba(237, 193, 94, 0.18);
    --accent-sage: #69cf9c;
    --accent-sage-soft: rgba(74, 184, 128, 0.18);
    --accent-amber: #97d48c;
    --accent-amber-soft: rgba(124, 196, 114, 0.18);
    --featured-border: rgba(237, 193, 94, 0.34);

    --status-ok: #68d19b;
    --status-ok-bg: rgba(70, 180, 124, 0.18);
    --status-warn: #f0b15e;
    --status-warn-bg: rgba(236, 166, 72, 0.18);

    /* Deep Pine/Moss Forest Canopy + Occasional Golden Canopy Sunbeams (8-stop eased oklab) */
    --orb-primary: radial-gradient(circle in oklab, rgba(18, 92, 56, 0.46) 0%, rgba(16, 84, 51, 0.37) 10%, rgba(14, 74, 45, 0.25) 21%, rgba(12, 62, 38, 0.14) 32%, rgba(10, 52, 32, 0.065) 43%, rgba(9, 44, 27, 0.022) 53%, rgba(8, 38, 24, 0.005) 62%, rgba(8, 38, 24, 0) 70%);
    --orb-secondary: radial-gradient(circle in oklab, rgba(34, 114, 68, 0.34) 0%, rgba(28, 100, 60, 0.27) 10%, rgba(22, 86, 52, 0.18) 21%, rgba(16, 70, 42, 0.10) 32%, rgba(13, 56, 34, 0.045) 43%, rgba(11, 46, 28, 0.015) 53%, rgba(10, 40, 24, 0.004) 62%, rgba(10, 40, 24, 0) 70%);
    --orb-accent: radial-gradient(circle in oklab, rgba(12, 68, 58, 0.36) 0%, rgba(11, 60, 52, 0.28) 10%, rgba(10, 52, 45, 0.19) 21%, rgba(8, 44, 38, 0.105) 32%, rgba(7, 36, 31, 0.048) 43%, rgba(6, 30, 26, 0.016) 53%, rgba(6, 28, 24, 0.004) 62%, rgba(6, 28, 24, 0) 70%);
    --orb-dapple: radial-gradient(circle in oklab, rgba(236, 198, 92, 0.30) 0%, rgba(214, 192, 88, 0.23) 9%, rgba(186, 182, 82, 0.15) 19%, rgba(154, 170, 78, 0.082) 30%, rgba(122, 146, 72, 0.036) 40%, rgba(92, 116, 62, 0.012) 50%, rgba(72, 92, 54, 0.003) 58%, rgba(72, 92, 54, 0) 65%);
    --canopy-ray: linear-gradient(128deg in oklab, transparent 18%, rgba(240, 206, 108, 0.02) 26%, rgba(240, 206, 108, 0.075) 34%, rgba(240, 206, 108, 0.13) 42%, rgba(188, 194, 104, 0.10) 49%, rgba(116, 176, 98, 0.055) 56%, rgba(116, 176, 98, 0.015) 63%, transparent 70%);
    --canopy-ray-peak: 0.72;
    --dapple-peak: 0.65;
    --texture-opacity: 0.036;

    --tooltip-bg: rgba(232, 244, 236, 0.96);
    --tooltip-text: #0a1610;
    --tooltip-warn: #8c3d04;
}

html[data-theme="light"] {
    color-scheme: light;
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 96px;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    background-image: var(--bg-canvas);
    background-attachment: fixed;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
    transition: background-color 280ms ease, color 240ms ease;
}

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 0.12em 0.4em;
    border-radius: 6px;
    background: rgba(128, 148, 136, 0.18);
}

/* ==========================================================================
   Living GPU-Composited Ambient Background
   Golden Meadow + Blue Sky (Light) / Deep Forest + Canopy Sunlight (Dark)
   ========================================================================== */
.ambient-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    contain: strict;
    z-index: 0;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
}

/* Primary warmth (Meadow Gold / Deep Pine Emerald) */
.ambient-orb--primary {
    width: 54vmax;
    height: 54vmax;
    top: -16vmax;
    left: -12vmax;
    background: var(--orb-primary);
    will-change: transform;
    animation: drift-primary 34s ease-in-out infinite alternate;
}

/* Secondary splash (Clear Blue Sky / Moss & Fern Mid-Canopy) */
.ambient-orb--secondary {
    width: 50vmax;
    height: 50vmax;
    top: -6vmax;
    right: -14vmax;
    background: var(--orb-secondary);
    will-change: transform;
    animation: drift-secondary 44s ease-in-out infinite alternate;
}

/* Grounding layer (Sunlit Clover / Deep Spruce Teal — static cached depth) */
.ambient-orb--accent {
    width: 58vmax;
    height: 58vmax;
    bottom: -24vmax;
    left: 16vw;
    background: var(--orb-accent);
}

/* Dappled sunlight orb (static cached depth) */
.ambient-orb--dapple {
    width: 44vmax;
    height: 44vmax;
    top: 18vh;
    left: 34vw;
    background: var(--orb-dapple);
    opacity: 0.45;
}

/* Soft slanted sunbeam filtering across the canopy / meadow (static cached depth) */
.ambient-canopy-ray {
    position: absolute;
    inset: -25%;
    background: var(--canopy-ray);
    opacity: 0.36;
    transform: rotate(-1.5deg);
}

/* Monochrome pixel-dither grain active even in deep shadows (breaks 8-bit Mach bands) */
.ambient-texture {
    position: absolute;
    inset: 0;
    opacity: var(--texture-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 140px 140px;
    background-repeat: repeat;
    mix-blend-mode: normal;
}

@keyframes drift-primary {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(12vw, 8vh, 0); }
    100% { transform: translate3d(20vw, -3vh, 0); }
}

@keyframes drift-secondary {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(-14vw, 12vh, 0); }
    100% { transform: translate3d(-6vw, 18vh, 0); }
}

/* Respect OS reduced-motion preference, user toggle, and hidden/unfocused windows */
@media (prefers-reduced-motion: reduce) {
    .ambient-orb,
    .live-dot {
        animation-play-state: paused !important;
    }
}

html[data-reduce-motion="true"] .ambient-orb,
html[data-reduce-motion="true"] .live-dot,
html.is-ambient-paused .ambient-orb,
html.is-ambient-paused .live-dot {
    animation-play-state: paused !important;
}

/* ==========================================================================
   True Glassmorphic Frosted Surface (Translucent + Optical Edge Reflections)
   ========================================================================== */
.glass-surface {
    position: relative;
    background-color: var(--glass-bg);
    background-image: var(--glass-sheen);
    border: 1px solid var(--glass-border);
    box-shadow:
        var(--glass-shadow),
        inset 0 1px 1px var(--glass-highlight-top),
        inset 1px 0 1px var(--glass-highlight-bottom),
        inset 0 -1px 1px var(--glass-highlight-bottom);
    transition: background-color 220ms ease, border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.modal-dialog.glass-surface,
.combobox-menu.glass-surface,
.sticky-save-bar.glass-surface {
    backdrop-filter: blur(18px) saturate(155%);
    -webkit-backdrop-filter: blur(18px) saturate(155%);
}

/* Specular diagonal glass reflection band (clipped strictly to border-radius, never clips child tooltips) */
.glass-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--glass-glint);
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 240ms ease;
}

.glass-surface > * {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */
.app-shell {
    position: relative;
    z-index: 1;
    max-width: 1040px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

/* Scroll-activated progressive frosted mist dissolving rising page content cleanly */
.topbar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 94px;
    z-index: 100;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    background: var(--topbar-veil);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 66%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 66%, transparent 100%);
    transition: opacity 220ms ease, visibility 220ms ease;
}

html.is-scrolled .topbar-backdrop {
    visibility: visible;
    opacity: 1;
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.topbar {
    position: sticky;
    top: 14px;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
}

html.is-scrolled .topbar {
    background-color: var(--topbar-bg-scrolled);
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.015em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-sun-soft);
    color: var(--accent-sun);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.brand-name {
    font-size: 1rem;
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Compact Header Theme Menu */
.theme-menu {
    position: relative;
}

.theme-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    background: rgba(128, 148, 136, 0.14);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.theme-menu-trigger:hover,
.theme-menu.is-open .theme-menu-trigger {
    background: var(--glass-bg-hover);
    border-color: var(--accent-sage);
    color: var(--text-primary);
}

.theme-menu.is-open .theme-menu-trigger[data-tooltip]::after {
    display: none;
}

.theme-icon {
    display: none;
    flex-shrink: 0;
}

.theme-menu[data-active-theme="light"] .theme-icon--light,
.theme-menu[data-active-theme="system"] .theme-icon--system,
.theme-menu[data-active-theme="dark"] .theme-icon--dark,
.theme-menu:not([data-active-theme]) .theme-icon--system {
    display: block;
}

.theme-menu-chevron {
    color: var(--text-muted);
    transition: transform 150ms ease;
}

.theme-menu.is-open .theme-menu-chevron {
    transform: rotate(180deg);
}

.theme-menu-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 215px;
    padding: 6px;
    border-radius: var(--radius-md);
    background-color: var(--topbar-bg-scrolled);
    background-image: var(--glass-sheen);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 220;
}

.theme-menu-option {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.theme-menu-option:hover {
    background: var(--glass-bg-hover);
}

.theme-menu-option.is-active {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
}

.theme-menu-option-main {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.theme-menu-option-main span {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.theme-menu-option-main small {
    font-size: 0.72rem;
}

.theme-menu-check {
    color: var(--accent-sage);
    font-weight: 700;
    opacity: 0;
}

.theme-menu-option.is-active .theme-menu-check {
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 28px;
}

.home-greeting {
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(56px, 11vh, 118px) 16px clamp(38px, 7vh, 76px);
}

.home-greeting-text {
    margin: 0;
    font-size: clamp(2.05rem, 4.4vw, 3.15rem);
    font-weight: 450;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text-note);
}

.home-greeting-name {
    font-size: 1.14em;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.hero {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-sun);
    background: var(--accent-sun-soft);
    border: 1px solid var(--glass-border);
    padding: 4px 13px;
    border-radius: var(--radius-pill);
    margin-bottom: 14px;
}

.hero-title {
    margin: 0 0 12px;
    font-size: clamp(1.85rem, 3.6vw, 2.55rem);
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.18;
}

.hero-subtitle {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

/* 3-Action Cards */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.action-card {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.action-card-btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.action-card:hover {
    transform: translateY(-3px);
    background-color: var(--glass-bg-hover);
}

.action-card:hover::before {
    opacity: 1;
}

.action-card--featured {
    border-color: var(--featured-border);
}

.action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.action-icon--amber {
    background: var(--accent-amber-soft);
    color: var(--accent-amber);
}

.action-icon--sun {
    background: var(--accent-sun-soft);
    color: var(--accent-sun);
}

.action-icon--sage {
    background: var(--accent-sage-soft);
    color: var(--accent-sage);
}

.action-title {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.action-desc {
    margin: 0;
    flex: 1;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.phase-tag {
    align-self: flex-start;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
}

/* Status Strip */
.status-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    margin-top: auto;
    margin-bottom: -18px;
    border-radius: var(--radius-md);
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.status-value {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-primary);
}

.status-link {
    color: var(--accent-sun);
    text-decoration: none;
}

.status-link:hover {
    text-decoration: underline;
}

/* Footer */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.84rem;
    color: var(--text-muted);
    padding: 0 6px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--glass-border);
}

.status-badge--ok {
    color: var(--status-ok);
    background: var(--status-ok-bg);
}

.status-badge--warn {
    color: var(--status-warn);
    background: var(--status-warn-bg);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* Accessible Tooltip Primitive (reused across RBAC & Dashboard) */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    pointer-events: none;
    z-index: 40;
}

/* Open tooltips inside the sticky topbar downward so they never clip off the top edge */
.topbar [data-tooltip]:hover::after,
.topbar [data-tooltip]:focus-visible::after {
    bottom: auto;
    top: calc(100% + 10px);
}

/* Focus Visibility & Skip Link */
:focus-visible {
    outline: 2px solid var(--accent-sun);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    top: -120px;
    left: 16px;
    z-index: 2000;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: top 120ms ease;
}

.skip-link:focus-visible {
    top: 14px;
}

/* ==========================================================================
   Phase 1 — Navigation, Auth Cards, Forms, Settings Sidebar & Canopy RBAC UI
   100% Glassmorphic Golden Meadow (Light) & Deep Forest (Dark)
   ========================================================================== */
.app-shell {
    max-width: 1140px;
}

.is-collapsed {
    display: none !important;
}

.stack-xs { display: flex; flex-direction: column; gap: 0.35rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.65rem; }
.stack-md { display: flex; flex-direction: column; gap: 1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.4rem; }
.inline-form { display: inline; margin: 0; }
.divider-top { border-top: 1px solid var(--glass-border); padding-top: 1rem; }
.muted { color: var(--text-secondary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.78rem; }

/* Topbar Navigation */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
}

.nav-link.is-active {
    color: var(--text-primary);
    background: var(--accent-sun-soft);
    border: 1px solid var(--glass-border);
}

.user-chip {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: rgba(128, 148, 136, 0.14);
    border: 1px solid var(--glass-border);
}

/* Cards & Headers */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.page-header h1,
.auth-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.card {
    padding: 22px 24px;
    border-radius: var(--radius-lg);
}

.card-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card h2,
.sub-tile h2 {
    margin: 0;
    font-size: 1.14rem;
    font-weight: 650;
    letter-spacing: -0.015em;
}

.card h3,
.sub-tile h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card p,
.sub-tile p {
    margin: 0;
}

.section-tile-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--subtile-border);
}

.sub-tile {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--subtile-border);
    background: var(--subtile-bg);
    box-shadow: inset 0 1px 0 var(--subtile-highlight);
    transition: background-color 160ms ease, border-color 160ms ease;
}

.sub-tile--compact {
    padding: 12px 14px;
}

.sub-tile--empty {
    padding: 16px 18px;
    border-style: dashed;
}

.sub-tile-label {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--text-primary);
}

.sub-tile.project-tile {
    background-color: var(--subtile-bg);
    background-image: linear-gradient(
        135deg,
        color-mix(in srgb, var(--project-accent, var(--accent-sage)) var(--project-tint-start), transparent) 0%,
        color-mix(in srgb, var(--project-accent, var(--accent-sage)) var(--project-tint-end), transparent) 100%
    );
    border-color: color-mix(in srgb, var(--project-accent, var(--accent-sage)) var(--project-tint-border), var(--subtile-border));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--project-accent, var(--accent-sage)) var(--project-tint-highlight), var(--subtile-highlight));
}

/* Auth Center Layout */
.auth-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 30px 28px;
    border-radius: var(--radius-lg);
}

.auth-footnote {
    text-align: center;
    margin: 4px 0 0;
}

.policy-box {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--subtile-bg);
    border: 1px solid var(--subtile-border);
    box-shadow: inset 0 1px 0 var(--subtile-highlight);
}

.policy-list {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Forms, Inputs & Buttons */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label,
.field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    min-height: 44px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(128, 148, 136, 0.10);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.94rem;
    transition: border-color 150ms ease, background-color 150ms ease;
}

input:disabled,
select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.toggle-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--subtile-border);
    background: var(--subtile-bg);
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    width: 17px;
    height: 17px;
    accent-color: var(--accent-sage);
    flex-shrink: 0;
}

.checkbox-row span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.9rem;
}

.checkbox-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(128, 148, 136, 0.12);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.checkbox-pill input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-sage);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.button-row--end {
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 140ms ease;
}

.btn-sm {
    min-height: 36px;
    padding: 5px 12px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--accent-sage);
    color: #ffffff;
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-sun);
}

.btn-ghost {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
}

.btn-danger {
    background: rgba(220, 68, 68, 0.16);
    border-color: rgba(220, 68, 68, 0.42);
    color: #ef6a6a;
}

.btn-danger:hover {
    background: rgba(220, 68, 68, 0.85);
    color: #ffffff;
}

/* Badges & Flash Alerts */
.badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 600;
}

.badge-accent  { background: var(--accent-sun-soft); color: var(--accent-sun); }
.badge-success { background: var(--status-ok-bg); color: var(--status-ok); }
.badge-danger  { background: rgba(220, 68, 68, 0.16); color: #ef6a6a; }
.badge-neutral { background: rgba(128, 148, 136, 0.18); color: var(--text-secondary); }
.badge-filter-active {
    background: var(--accent-sun-soft);
    color: var(--accent-sun);
    border: 1px solid var(--featured-border);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    border-color: var(--status-ok);
    background: var(--status-ok-bg);
    color: var(--status-ok);
}

.alert-error {
    border-color: rgba(220, 68, 68, 0.55);
    background: rgba(220, 68, 68, 0.14);
    color: #ef6a6a;
}

.credential-banner {
    border-color: var(--accent-sun);
    background: var(--accent-sun-soft);
}

.temp-password-code {
    font-size: 0.95rem;
    font-weight: 650;
    user-select: all;
}

.asset-tag {
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   Settings & Admin Collapsible Frosted Sidebar (Settings/Admin Only)
   ========================================================================== */
.settings-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.settings-layout.is-sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr);
}

.settings-sidebar {
    position: sticky;
    top: 94px;
    padding: 14px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: width 180ms ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.sidebar-collapse-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color 150ms ease, transform 180ms ease;
}

.sidebar-collapse-btn:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.settings-layout.is-sidebar-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

.settings-layout.is-sidebar-collapsed .sidebar-title,
.settings-layout.is-sidebar-collapsed .sidebar-group-label,
.settings-layout.is-sidebar-collapsed .sidebar-link-text {
    display: none;
}

.settings-layout.is-sidebar-collapsed .sidebar-header {
    justify-content: center;
}

.settings-layout.is-sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 10px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 4px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 150ms ease, color 150ms ease;
}

.sidebar-link:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.sidebar-link.is-active,
.sidebar-parent-link.is-parent-active {
    background: var(--accent-sage-soft);
    color: var(--accent-sage);
    font-weight: 600;
}

.sidebar-nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-parent {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-parent-link {
    flex: 1;
    min-width: 0;
}

.sidebar-subtoggle {
    width: 30px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 140ms ease, color 140ms ease;
}

.sidebar-subtoggle:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.sidebar-subtoggle svg {
    transition: transform 150ms ease;
}

.sidebar-subtoggle.is-open svg {
    transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-subtoggle svg {
        transition: none;
    }
}

.sidebar-subnav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 4px 16px;
    padding-left: 10px;
    border-left: 1px solid var(--glass-border);
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: background-color 140ms ease, color 140ms ease;
}

.sidebar-sublink:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.sidebar-sublink.is-active {
    background: var(--accent-sage-soft);
    color: var(--accent-sage);
    font-weight: 600;
}

.settings-layout.is-sidebar-collapsed .sidebar-subtoggle,
.settings-layout.is-sidebar-collapsed .sidebar-subnav {
    display: none;
}

@media (max-width: 820px) {
    .sidebar-nav-group {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    .sidebar-subnav {
        flex-direction: row;
        flex-wrap: wrap;
        margin: 0;
        padding-left: 0;
        border-left: none;
        gap: 4px;
    }
}

.settings-main {
    min-width: 0;
}

/* Admin Users Cards */
.user-edit-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roles-assign-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ==========================================================================
   Canopy-Pattern RBAC Directory, Segmented Separators & Dual Tooltips
   ========================================================================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.back-link:hover {
    color: var(--accent-sun);
}

.header-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.role-directory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.role-summary-card:hover {
    border-color: var(--accent-sage);
    background: var(--subtile-bg-hover);
}

.guide-card {
    border-color: var(--accent-sage-soft);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    padding-top: 6px;
}

.guide-step {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--subtile-bg);
    border: 1px solid var(--subtile-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-toggle {
    display: inline-flex;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(128, 148, 136, 0.10);
}

.mode-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-right: 1px solid var(--glass-border);
    transition: background-color 150ms ease, color 150ms ease;
}

.mode-toggle-btn:last-child {
    border-right: none;
}

.mode-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
}

.mode-toggle-btn-accent {
    color: var(--accent-sage);
}

.mode-toggle-btn-active {
    background: var(--accent-sage);
    color: #ffffff !important;
}

.role-info-drawer {
    padding-top: 12px;
    border-top: 1px dashed var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coverage-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.coverage-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(128, 148, 136, 0.08);
    font-size: 0.76rem;
    color: var(--text-muted);
}

.coverage-chip-active {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
    color: var(--text-primary);
}

/* Segmented Category Banner (1.x - 4.x) */
.permission-section-separator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-sage);
}

.section-separator-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.section-separator-title h2 {
    margin: 0;
    font-size: 1.12rem;
}

.section-separator-title p {
    margin: 0;
}

.section-prefix-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--accent-sage-soft);
    color: var(--accent-sage);
    font-size: 0.88rem;
    flex-shrink: 0;
}

.permission-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.group-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.group-title-row h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.group-code {
    color: var(--accent-sage);
    font-size: 0.88rem;
}

.permission-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.permission-option-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--subtile-border);
    background: var(--subtile-bg);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.sub-tile .permission-option-card {
    background: var(--option-nested-bg);
}

.permission-option-card.option-enabled,
.sub-tile .permission-option-card.option-enabled {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
}

.option-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.option-checkbox-label {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.option-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-sage);
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.option-readonly-status {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
}

.status-dot-on,
.status-dot-off {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
}

.status-dot-on {
    background: var(--status-ok);
    box-shadow: 0 0 8px var(--status-ok);
}

.status-dot-off {
    background: var(--glass-border);
}

/* Dual-Mode RBAC Tooltips (Hover/Focus Bubble + Click Inline Expand) */
.tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tooltip-trigger {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(128, 148, 136, 0.16);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.tooltip-trigger-sm {
    width: 21px;
    height: 21px;
    font-size: 0.7rem;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus-visible {
    border-color: var(--accent-sage);
    color: var(--accent-sage);
}

.tooltip-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 270px;
    max-width: 78vw;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--tooltip-bg);
    border: 1px solid var(--accent-sage);
    color: var(--tooltip-text);
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 140ms ease;
    z-index: 200;
}

.tooltip-wrap-right .tooltip-bubble {
    left: auto;
    right: 0;
    transform: none;
}

.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus-within .tooltip-bubble {
    opacity: 1;
    visibility: visible;
}

.tooltip-inline-note {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 7px 10px;
    border-left: 2px solid var(--accent-sage);
    background: var(--accent-sage-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.option-description {
    margin: 0;
    font-size: 0.79rem;
    line-height: 1.4;
    color: var(--text-secondary);
    padding-top: 6px;
    border-top: 1px dashed var(--glass-border);
}

.sticky-save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

.danger-zone-card {
    border-color: rgba(220, 68, 68, 0.35);
}

.danger-zone-card h3 {
    margin: 0;
    font-size: 1rem;
}

@media (max-width: 820px) {
    .action-grid {
        grid-template-columns: 1fr;
    }

    .topbar-backdrop {
        height: 136px;
    }

    .topbar {
        top: 10px;
        flex-wrap: wrap;
        gap: 10px;
        padding: 8px 12px;
        border-radius: var(--radius-md);
    }

    .settings-layout,
    .settings-layout.is-sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .sidebar-header,
    .sidebar-group-label,
    .sidebar-collapse-btn {
        display: none;
    }

    .sidebar-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .settings-layout.is-sidebar-collapsed .sidebar-link-text {
        display: inline;
    }
}

/* ==========================================================================
   Phase 2 — Frosted Modal, Comboboxes, Swatches & Projects Governance
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 240;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 16, 12, 0.56);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-y: auto;
}

.modal-dialog {
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px 26px;
    border-radius: var(--radius-lg);
}

.field-header-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-link-inline {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--accent-sun);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-link-inline:hover {
    text-decoration: underline;
}

/* Searchable Comboboxes */
.combobox {
    position: relative;
}

.combobox input[type="search"] {
    width: 100%;
}

.combobox-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    max-height: 230px;
    overflow-y: auto;
    padding: 6px;
    border-radius: var(--radius-md);
    background: var(--glass-bg-hover);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.combobox-option {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
}

.combobox-option:hover,
.combobox-option.is-selected {
    background: var(--accent-sage-soft);
    border-color: var(--accent-sage);
}

.combobox-option-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.combobox-empty {
    padding: 10px;
    font-size: 0.84rem;
    color: var(--text-muted);
    text-align: center;
}

/* Quick-Add Drawers & Color Swatches */
.quick-add-box {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--subtile-border);
    background: var(--subtile-bg);
}

.swatch-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.swatch-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 0;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.swatch-btn.is-selected {
    transform: scale(1.16);
    box-shadow: 0 0 0 2px var(--accent-sun);
}

.project-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Recent Entries & Attention Callout */
.recent-entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--subtile-border);
    background: var(--subtile-bg);
    box-shadow: inset 0 1px 0 var(--subtile-highlight);
}

.recent-entry-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.attention-callout {
    border-color: var(--accent-sun);
    background: var(--accent-sun-soft);
}

/* Admin Atomic Merge Task Mapping Rows */
.merge-map-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(128, 148, 136, 0.08);
    border: 1px solid var(--glass-border);
}

.merge-task-select {
    min-width: 220px;
    flex: 1;
}

/* Quick-Add Project 3-State Visibility Selector */
.visibility-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 8px;
}

.visibility-choice-card {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(128, 148, 136, 0.08);
    cursor: pointer;
    font-size: 0.86rem;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.visibility-choice-card:hover {
    background: var(--glass-bg-hover);
}

.visibility-choice-card input[type="radio"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-sage);
    flex-shrink: 0;
}

.visibility-choice-card:has(input:checked) {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
}

/* Task Category Groups — Collapsible Sections & Group-Scoped Pool Pickers */
.btn-xs {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 0.76rem;
    border-radius: 7px;
}

.pool-group-section {
    border: 1px solid var(--subtile-border);
    border-radius: var(--radius-md);
    background: var(--subtile-bg);
    box-shadow: inset 0 1px 0 var(--subtile-highlight);
    overflow: hidden;
}

.pool-group-section--archived {
    border-style: dashed;
}

.pool-group-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color 140ms ease;
}

.pool-group-summary::-webkit-details-marker {
    display: none;
}

.pool-group-summary:hover {
    background: var(--glass-bg-hover);
}

.pool-group-summary-main {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 200px;
}

.pool-group-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 160ms ease;
}

.pool-group-section[open] > .pool-group-summary .pool-group-chevron,
.pool-picker-group[open] > .pool-picker-summary .pool-group-chevron,
.combobox-group[open] > .combobox-group-header .pool-group-chevron {
    transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
    .pool-group-chevron {
        transition: none;
    }
}

.pool-group-body {
    padding: 12px 14px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pool-picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pool-picker-group {
    border: 1px solid var(--subtile-border);
    border-radius: var(--radius-sm);
    background: var(--subtile-bg);
}

.pool-picker-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 11px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.pool-picker-summary::-webkit-details-marker {
    display: none;
}

.pool-picker-summary:hover {
    background: var(--glass-bg-hover);
}

.pool-picker-body {
    padding: 8px 11px 11px;
    border-top: 1px dashed var(--glass-border);
}

.combobox-group {
    border-radius: var(--radius-sm);
}

.combobox-group + .combobox-group {
    margin-top: 4px;
}

.combobox-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
    border-radius: 6px;
}

.combobox-group-header::-webkit-details-marker {
    display: none;
}

.combobox-group-header:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.combobox-group-items {
    padding-left: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ==========================================================================
   Project Chart Color Swatch Picker (Grouped Full Spectrum)
   ========================================================================== */
.color-picker {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-trigger {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--subtile-border);
    background: var(--subtile-bg);
    box-shadow: inset 0 1px 0 var(--subtile-highlight);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.color-picker-trigger:hover,
.color-picker.is-open .color-picker-trigger {
    border-color: var(--accent-sage);
    background: var(--subtile-bg-hover);
}

.color-picker-trigger-main {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    min-width: 0;
}

.color-picker-trigger-name {
    font-weight: 600;
}

.color-picker-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 160ms ease;
}

.color-picker.is-open .color-picker-chevron {
    transform: rotate(180deg);
}

.color-swatch-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.color-swatch-dot--lg {
    width: 18px;
    height: 18px;
}

.color-picker-panel {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--subtile-border);
    background: var(--subtile-bg);
    box-shadow: inset 0 1px 0 var(--subtile-highlight);
    max-height: 340px;
    overflow-y: auto;
}

.modal-dialog .color-picker-panel {
    max-height: 260px;
}

.color-family-group + .color-family-group {
    padding-top: 8px;
    border-top: 1px dashed var(--subtile-border);
}

.color-family-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.color-family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
}

.color-swatch-option {
    width: 100%;
    padding: 6px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--subtile-border);
    background: var(--option-nested-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color 130ms ease, background-color 130ms ease;
}

.color-swatch-option:hover {
    border-color: var(--accent-sage);
    background: var(--subtile-bg-hover);
}

.color-swatch-option.is-selected {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
    font-weight: 650;
}

.color-swatch-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Phase 3: Live Timer Bar, Entries View, PiP Mini-Window & Micro-Celebrations
   ========================================================================== */
.timer-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-top: -18px;
}

.timer-bar.is-expanded {
    padding: 12px 16px 16px;
}

.timer-bar-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.timer-bar-details {
    padding-top: 12px;
    border-top: 1px solid var(--subtile-border);
}

.timer-bar-details-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.timer-bar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.timer-bar-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.timer-bar-actions {
    flex-shrink: 0;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-sage);
    box-shadow: 0 0 0 4px var(--accent-sage-soft);
    animation: sfPulseDot 2.2s ease-in-out infinite;
}

.live-dot.is-paused {
    background: var(--accent-sun);
    box-shadow: none;
    animation: none;
}

@keyframes sfPulseDot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

.timer-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 1.05rem;
}

.home-timer-card {
    padding: 20px 22px;
    border-radius: var(--radius-lg);
}

.home-timer-clock-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.timer-clock--hero {
    font-size: clamp(2rem, 4.2vw, 2.75rem);
    line-height: 1.05;
    color: var(--text-primary);
}

.timer-clock--pip {
    font-size: 2rem;
    line-height: 1.1;
    text-align: center;
    padding: 4px 0;
}

.save-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    background: var(--subtile-bg);
    color: var(--text-secondary);
    opacity: 1;
    transition: opacity 280ms ease, border-color 180ms ease, color 180ms ease;
}

.save-status-pill.is-saving {
    border-color: var(--accent-sun);
    background: var(--accent-sun-soft);
    color: var(--accent-sun);
}

.save-status-pill.is-saved {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
    color: var(--accent-sage);
}

.save-status-pill.is-error {
    border-color: rgba(196, 67, 67, 0.5);
    color: #c94a4a;
}

.save-status-pill.is-faded {
    opacity: 0;
    pointer-events: none;
}

.attention-section-card {
    border-color: var(--accent-sun);
}

.attention-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 10px;
}

.attention-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.attention-card-actions {
    margin-left: auto;
}

.entry-readonly-time {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--subtile-border);
    background: var(--option-nested-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.entries-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.entries-filters-drawer {
    padding: 12px 14px;
}

.entries-filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--subtile-border);
}

.entries-pagination-bar {
    padding-top: 10px;
    border-top: 1px solid var(--subtile-border);
}

.entries-log-stream {
    display: flex;
    flex-direction: column;
}

.entries-log-stream.stack-sm {
    gap: 6px;
}

.sub-tile.entry-row {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
}

.sub-tile.entry-row.stack-xs {
    gap: 3px;
}

.entry-note-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding-left: 17px;
    min-width: 0;
}

.entry-note-text {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 0.74rem;
    line-height: 1.38;
    color: var(--text-note);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-note-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
    border: 1px solid var(--subtile-border);
    border-radius: var(--radius-pill);
    background: var(--option-nested-bg);
    color: var(--accent-sage);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.45;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.entry-note-toggle:hover {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
}

.entry-note-row.is-expanded {
    display: block;
}

.entry-note-row.is-expanded .entry-note-text {
    display: inline;
    white-space: pre-wrap;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.entry-note-row.is-expanded .entry-note-toggle {
    margin-left: 6px;
    vertical-align: baseline;
}

.entry-row-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.entry-row-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
    flex: 1 1 320px;
}

.entry-row-meta {
    color: var(--text-muted);
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 420px;
}

.entry-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.entry-date-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 1px;
    padding: 2px 2px;
}

.entry-date-divider--first {
    margin-top: 0;
}

.entry-date-divider-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.entry-date-divider-line {
    flex: 1;
    height: 1px;
    background: var(--subtile-border);
}

.entry-date-divider-total {
    font-size: 0.74rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    white-space: nowrap;
}

.entry-segments-panel {
    padding-top: 8px;
    border-top: 1px dashed var(--subtile-border);
}

.segment-item {
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    background: var(--option-nested-bg);
    border: 1px solid var(--subtile-border);
}

.breakout-drawer {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--subtile-bg);
    border: 1px solid var(--accent-sage);
    margin-top: 6px;
}

/* Floating Document Picture-in-Picture Mini-Timer */
.pip-body {
    margin: 0;
    min-height: 100vh;
    padding: 10px;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: var(--bg-base);
}

.pip-shell {
    flex: 1;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pip-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.pip-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.pip-labels {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pip-project-name,
.pip-task-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pip-controls-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pip-task-select {
    flex: 1;
    min-width: 0;
    min-height: 30px;
    padding: 4px 8px;
    font-size: 0.78rem;
}

/* Phase 4 Offline Resilience Banner & Disconnect Recovery Modal */
.offline-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-top: 10px;
    font-size: 0.86rem;
    border: 1px solid var(--glass-border);
    transition: border-color 180ms ease, background-color 180ms ease;
}

.offline-banner-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.offline-banner-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-sun);
}

.offline-banner--offline {
    border-color: var(--accent-sun);
    background: var(--accent-sun-soft);
}

.offline-banner--syncing {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
}

.offline-banner--syncing .offline-banner-dot {
    background: var(--accent-sage);
}

.offline-banner--online {
    border-color: var(--accent-sage);
    background: var(--accent-sage-soft);
}

.offline-banner--online .offline-banner-dot {
    background: var(--accent-sage);
}

.offline-banner--warning {
    border-color: var(--danger);
    background: rgba(201, 74, 74, 0.14);
}

.offline-banner--warning .offline-banner-dot {
    background: var(--danger);
}

.recovery-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.recovery-panel {
    padding: 12px 14px;
}

/* Subtle Completion Micro-Celebration */
.sf-shimmer-burst {
    position: fixed;
    width: 0;
    height: 0;
    z-index: 950;
    pointer-events: none;
}

.sf-sparkle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-sun) 0%, var(--accent-sage) 100%);
    opacity: 0;
    animation: sfSparklePop 1.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sfSparklePop {
    0% {
        opacity: 0;
        transform: translate3d(-50%, -50%, 0) scale(0.4);
    }
    25% {
        opacity: 0.95;
        transform: translate3d(calc(-50% + var(--sf-dx) * 0.45), calc(-50% + var(--sf-dy) * 0.45), 0) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate3d(calc(-50% + var(--sf-dx)), calc(-50% + var(--sf-dy)), 0) scale(0.35);
    }
}

html[data-reduce-motion="true"] .live-dot {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .live-dot {
        animation: none;
    }
}

html[data-reduce-motion="true"] .sf-shimmer-burst {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .sf-shimmer-burst {
        display: none;
    }
}

/* ==========================================================================
   Phase 5 — Visual Analytics Dashboard & Safe Exports
   ========================================================================== */
.dashboard-filter-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dashboard-context-sentinel {
    height: 0;
    margin: 0 0 -1.4rem 0;
    padding: 0;
    pointer-events: none;
}

.dashboard-active-bar {
    position: sticky;
    top: var(--dashboard-sticky-top, 76px);
    z-index: 105;
    padding: 13px 18px;
    border-radius: var(--radius-md);
    transition: padding 180ms ease, background-color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-active-bar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.dashboard-active-range {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dashboard-active-range-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dashboard-active-dates {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.dashboard-active-dates--compact {
    display: none;
}

.dashboard-active-aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dashboard-active-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.dashboard-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    background: var(--subtile-bg);
    font-size: 0.8rem;
    line-height: 1.25;
    color: var(--text-primary);
    max-width: 100%;
}

.dashboard-filter-chip--accent {
    background: var(--accent-sage-soft);
    border-color: rgba(45, 140, 102, 0.32);
}

.dashboard-filter-chip-label {
    color: var(--text-muted);
    font-weight: 500;
}

.dashboard-filter-chip-val {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.dashboard-filter-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dashboard-jump-filters-btn {
    display: none;
    flex-shrink: 0;
}

.dashboard-active-bar.is-stuck {
    padding: 7px 14px;
    background-color: var(--topbar-bg-scrolled);
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    box-shadow:
        0 10px 26px rgba(10, 24, 18, 0.14),
        inset 0 1px 1px var(--glass-highlight-top);
}

.dashboard-active-bar.is-stuck .dashboard-active-eyebrow,
.dashboard-active-bar.is-stuck .dashboard-active-dates--detailed {
    display: none;
}

.dashboard-active-bar.is-stuck .dashboard-active-dates--compact {
    display: inline;
    font-size: 0.84rem;
    white-space: nowrap;
}

.dashboard-active-bar.is-stuck .dashboard-active-bar-main {
    flex-wrap: nowrap;
    gap: 10px;
}

.dashboard-active-bar.is-stuck .dashboard-active-range-line {
    flex-wrap: nowrap;
    gap: 6px;
}

.dashboard-active-bar.is-stuck .dashboard-active-preset-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    flex-shrink: 0;
}

.dashboard-active-bar.is-stuck .dashboard-active-aside {
    flex-wrap: nowrap;
    min-width: 0;
    gap: 6px;
}

.dashboard-active-bar.is-stuck .dashboard-active-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dashboard-active-bar.is-stuck .dashboard-active-chips::-webkit-scrollbar {
    display: none;
}

.dashboard-active-bar.is-stuck .dashboard-filter-chip {
    padding: 3px 8px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.dashboard-active-bar.is-stuck .dashboard-filter-chip-label {
    display: none;
}

.dashboard-active-bar.is-stuck .dashboard-filter-chip--private .dashboard-filter-chip-label {
    display: inline;
}

.dashboard-active-bar.is-stuck .dashboard-jump-filters-btn {
    display: inline-flex;
    padding: 3px 9px;
    min-height: 26px;
    font-size: 0.74rem;
}

html[data-reduce-motion="true"] .dashboard-active-bar {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-active-bar {
        transition: none;
    }
}

.preset-pill {
    min-height: 36px;
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    background: var(--subtile-bg);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.preset-pill:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.preset-pill.is-active {
    background: var(--accent-sage-soft);
    border-color: var(--accent-sage);
    color: var(--accent-sage);
}

.dashboard-custom-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.dashboard-date-field input[type="date"] {
    min-height: 36px;
    padding: 5px 10px;
    font-size: 0.84rem;
}

.dashboard-filter-selects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.dashboard-filter-extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 2px;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.dashboard-kpi-card {
    padding: 18px 20px;
}

.dashboard-kpi-value {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.15;
}

.dashboard-kpi-value--sm {
    font-size: 1.25rem;
}

.dashboard-kpi-focus-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dashboard-kpi-focus-title {
    font-size: 1.08rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-active-timers {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--subtile-border);
}

.dashboard-live-timer-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--status-ok-bg);
    color: var(--text-primary);
}

.timer-clock-inline {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.dashboard-chart-shell {
    width: 100%;
    overflow-x: auto;
}

.dashboard-svg-chart {
    width: 100%;
    height: auto;
    display: block;
}

.dashboard-grid-line {
    stroke: var(--subtile-border);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.dashboard-axis-text {
    fill: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-sans);
}

.dashboard-bar-segment,
.dashboard-donut-slice {
    cursor: pointer;
    transition: opacity 140ms ease, filter 140ms ease;
}

.dashboard-bar-segment:hover,
.dashboard-donut-slice:hover {
    opacity: 0.86;
    filter: brightness(1.08);
}

.dashboard-bar-segment:focus-visible,
.dashboard-donut-slice:focus-visible {
    opacity: 0.92;
    filter: brightness(1.1);
    outline: 2px solid var(--accent-sun);
    outline-offset: 2px;
}

.dashboard-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--subtile-border);
    background: var(--subtile-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.dashboard-legend-chip:hover {
    background: var(--subtile-bg-hover);
}

.dashboard-legend-chip.is-attention {
    border-color: rgba(217, 130, 43, 0.55);
}

.dashboard-mid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 18px;
    align-items: start;
}

.dashboard-breakdown-layout {
    display: grid;
    grid-template-columns: minmax(160px, 185px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.dashboard-donut-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-donut-svg {
    width: 176px;
    height: 176px;
}

.dashboard-donut-track {
    stroke: var(--subtile-border);
}

.dashboard-donut-center-label {
    fill: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-sans);
}

.dashboard-donut-center-value {
    fill: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-sans);
}

.dashboard-breakdown-row {
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
}

.dashboard-breakdown-row.is-attention {
    border-color: rgba(217, 130, 43, 0.5);
}

.dashboard-share-track {
    width: 100%;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--subtile-border);
    overflow: hidden;
}

.dashboard-share-fill {
    height: 100%;
    border-radius: var(--radius-pill);
}

.dashboard-heatmap-shell {
    overflow-x: auto;
    padding-bottom: 4px;
}

.dashboard-heatmap-months {
    display: grid;
    gap: 4px;
    padding-left: 34px;
    min-width: max-content;
}

.dashboard-heatmap-month-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.dashboard-heatmap-body {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.dashboard-heatmap-weekdays {
    display: grid;
    grid-template-rows: repeat(7, 14px);
    gap: 4px;
    width: 26px;
    flex-shrink: 0;
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 14px;
}

.dashboard-heatmap-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, 14px);
    gap: 4px;
}

.heatmap-cell {
    width: 14px;
    height: 14px;
    padding: 0;
    border-radius: 3px;
    border: 1px solid var(--subtile-border);
    background: var(--subtile-bg);
    cursor: pointer;
    transition: transform 110ms ease, border-color 110ms ease;
}

.heatmap-cell:hover {
    transform: scale(1.18);
    border-color: var(--accent-sage);
}

.heatmap-cell:focus-visible {
    transform: scale(1.18);
    border-color: var(--accent-sun);
    outline: 2px solid var(--accent-sun);
    outline-offset: 2px;
}

.heatmap-cell--legend {
    display: inline-block;
    cursor: default;
}

.heatmap-cell--legend:hover {
    transform: none;
}

.heatmap-cell[data-level="1"] { background: rgba(45, 140, 102, 0.28); border-color: rgba(45, 140, 102, 0.35); }
.heatmap-cell[data-level="2"] { background: rgba(45, 140, 102, 0.52); border-color: rgba(45, 140, 102, 0.58); }
.heatmap-cell[data-level="3"] { background: rgba(35, 116, 85, 0.78); border-color: rgba(35, 116, 85, 0.85); }
.heatmap-cell[data-level="4"] { background: #1f6e4e; border-color: #17543b; }

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .heatmap-cell[data-level="1"] { background: rgba(105, 207, 156, 0.24); border-color: rgba(105, 207, 156, 0.34); }
    html[data-theme="system"] .heatmap-cell[data-level="2"] { background: rgba(105, 207, 156, 0.45); border-color: rgba(105, 207, 156, 0.55); }
    html[data-theme="system"] .heatmap-cell[data-level="3"] { background: rgba(105, 207, 156, 0.72); border-color: rgba(105, 207, 156, 0.82); }
    html[data-theme="system"] .heatmap-cell[data-level="4"] { background: #7de3ae; border-color: #a8f0ca; }
}

html[data-theme="dark"] .heatmap-cell[data-level="1"] { background: rgba(105, 207, 156, 0.24); border-color: rgba(105, 207, 156, 0.34); }
html[data-theme="dark"] .heatmap-cell[data-level="2"] { background: rgba(105, 207, 156, 0.45); border-color: rgba(105, 207, 156, 0.55); }
html[data-theme="dark"] .heatmap-cell[data-level="3"] { background: rgba(105, 207, 156, 0.72); border-color: rgba(105, 207, 156, 0.82); }
html[data-theme="dark"] .heatmap-cell[data-level="4"] { background: #7de3ae; border-color: #a8f0ca; }

.dashboard-heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.dashboard-attention-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.dashboard-attn-user-card {
    border-color: rgba(217, 130, 43, 0.45);
}

.dashboard-team-track {
    display: flex;
    align-items: stretch;
    height: 12px;
    border-radius: var(--radius-pill);
    background: var(--subtile-bg);
    border: 1px solid var(--subtile-border);
    overflow: hidden;
    gap: 1px;
}

.dashboard-team-seg {
    height: 100%;
    cursor: pointer;
    transition: opacity 120ms ease;
}

.dashboard-team-seg.is-attention {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(255, 255, 255, 0.35) 4px,
        rgba(255, 255, 255, 0.35) 7px
    );
}

.dashboard-team-seg:hover {
    opacity: 0.84;
}

.dashboard-team-seg:focus-visible {
    opacity: 0.92;
    outline: 2px solid var(--accent-sage);
    outline-offset: -2px;
}

.dashboard-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.dashboard-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.dashboard-summary-table th,
.dashboard-summary-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--subtile-border);
}

.table-sort-btn {
    padding: 2px 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.table-sort-btn:hover,
.table-sort-btn.is-active-sort {
    color: var(--text-primary);
}

.table-sort-btn:focus-visible {
    border-radius: 6px;
    outline: 2px solid var(--accent-sun);
    outline-offset: 2px;
}

.dashboard-tooltip {
    position: fixed;
    z-index: 1200;
    max-width: 280px;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.78rem;
}

.dashboard-tooltip-title {
    font-weight: 700;
}

.dashboard-tooltip-warn {
    color: var(--tooltip-warn);
    font-weight: 600;
}

@media (max-width: 720px) {
    .dashboard-breakdown-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-top,
    .dashboard-custom-dates {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-active-bar {
        padding: 11px 14px;
    }

    .dashboard-active-bar.is-stuck {
        padding: 6px 10px;
    }

    .dashboard-active-bar.is-stuck .dashboard-active-bar-main {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .dashboard-active-bar.is-stuck .dashboard-active-bar-main::-webkit-scrollbar {
        display: none;
    }

    .dashboard-active-bar.is-stuck .dashboard-active-range,
    .dashboard-active-bar.is-stuck .dashboard-active-aside {
        flex-shrink: 0;
    }

    .dashboard-kpi-grid,
    .dashboard-mid-grid {
        grid-template-columns: 1fr;
    }

    .timer-bar-header {
        align-items: flex-start;
    }

    .modal-dialog {
        padding: 18px 16px;
        max-height: calc(100vh - 24px);
    }
}

@media (max-width: 520px) {
    .topbar {
        padding: 8px 10px;
    }

    .topbar-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-backdrop {
        padding: 12px;
    }
}
