:root {
            --bg-main: #F5F5F5;
            --bg-secondary: #F4F6F8;
            --card-bg: #FFFFFF;
            --text-main: #202124;
            --text-secondary: #7B8088;
            --text-muted: #A1A6AD;
            --border-color: #EDF0F2;
            --accent-primary: #facc15;
            --accent-dark: #ca8a04;
            --accent: var(--accent-primary);
            --accent-mid: #eab308;
            --accent-soft: #fef9c3;
            --bg-primary-light: #fef9c3;
            --bg-primary-xlight: #fefce8;
            --positive: #22A06B;
            --negative: #E5484D;
            --warning: #F59E0B;
            --insight-gradient: linear-gradient(135deg, #facc15 0%, #eab308 100%);
            --side-nav-left: 10px;
            --side-nav-collapsed-width: 44px;
            --side-nav-expanded-width: 188px;
            --side-nav-content-gap: 22px;
            --side-nav-content-offset: calc(var(--side-nav-left) + var(--side-nav-collapsed-width) + var(--side-nav-content-gap));
            --side-nav-content-offset-expanded: calc(var(--side-nav-left) + var(--side-nav-expanded-width) + var(--side-nav-content-gap));
        }

html {
            background: var(--bg-main);
        }

html[data-accent="red"] {
            --accent-primary: #ef4444;
            --accent-dark: #b91c1c;
            --accent-mid: #dc2626;
            --accent-soft: #fee2e2;
            --bg-primary-light: #fee2e2;
            --bg-primary-xlight: #fef2f2;
            --insight-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
        }

html[data-accent="green"] {
            --accent-primary: #22c55e;
            --accent-dark: #15803d;
            --accent-mid: #16a34a;
            --accent-soft: #dcfce7;
            --bg-primary-light: #dcfce7;
            --bg-primary-xlight: #f0fdf4;
            --insight-gradient: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
        }

html[data-accent="blue"] {
            --accent-primary: #3b82f6;
            --accent-dark: #1d4ed8;
            --accent-mid: #2563eb;
            --accent-soft: #dbeafe;
            --bg-primary-light: #dbeafe;
            --bg-primary-xlight: #eff6ff;
            --insight-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        }

html[data-accent="orange"] {
            --accent-primary: #f97316;
            --accent-dark: #c2410c;
            --accent-mid: #ea580c;
            --accent-soft: #ffedd5;
            --bg-primary-light: #ffedd5;
            --bg-primary-xlight: #fff7ed;
            --insight-gradient: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
        }

html[data-accent="purple"] {
            --accent-primary: #8b5cf6;
            --accent-dark: #6d28d9;
            --accent-mid: #7c3aed;
            --accent-soft: #ede9fe;
            --bg-primary-light: #ede9fe;
            --bg-primary-xlight: #f5f3ff;
            --insight-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
        }

html[data-accent="pink"] {
            --accent-primary: #ec4899;
            --accent-dark: #be185d;
            --accent-mid: #db2777;
            --accent-soft: #fce7f3;
            --bg-primary-light: #fce7f3;
            --bg-primary-xlight: #fdf2f8;
            --insight-gradient: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
        }

html.theme-dark {
            --bg-main: #0f1115;
            --bg-secondary: #171a21;
            --card-bg: #1b1f27;
            --text-main: #F4F6F8;
            --text-secondary: #B4BBC6;
            --text-muted: #7F8794;
            --border-color: #2b303b00;
            --accent-primary: #facc15;
            --accent-dark: #fde047;
            --accent: var(--accent-primary);
            --accent-mid: #eab308;
            --accent-soft: rgba(250, 204, 21, 0.18);
            --bg-primary-light: rgba(250, 204, 21, 0.18);
            --bg-primary-xlight: rgba(250, 204, 21, 0.1);
            --positive: #3DDC97;
            --negative: #FF6B72;
            --warning: #FBBF24;
            --insight-gradient: linear-gradient(135deg, #3a2f08 0%, #1f2937 100%);
        }

html.theme-dark[data-accent="red"] {
            --accent-primary: #f87171;
            --accent-dark: #fca5a5;
            --accent-mid: #ef4444;
            --accent-soft: rgba(248, 113, 113, 0.18);
            --bg-primary-light: rgba(248, 113, 113, 0.18);
            --bg-primary-xlight: rgba(248, 113, 113, 0.1);
            --insight-gradient: linear-gradient(135deg, #451a1a 0%, #1f2937 100%);
        }

html.theme-dark[data-accent="green"] {
            --accent-primary: #4ade80;
            --accent-dark: #86efac;
            --accent-mid: #22c55e;
            --accent-soft: rgba(74, 222, 128, 0.18);
            --bg-primary-light: rgba(74, 222, 128, 0.18);
            --bg-primary-xlight: rgba(74, 222, 128, 0.1);
            --insight-gradient: linear-gradient(135deg, #12351f 0%, #1f2937 100%);
        }

html.theme-dark[data-accent="blue"] {
            --accent-primary: #60a5fa;
            --accent-dark: #93c5fd;
            --accent-mid: #3b82f6;
            --accent-soft: rgba(96, 165, 250, 0.18);
            --bg-primary-light: rgba(96, 165, 250, 0.18);
            --bg-primary-xlight: rgba(96, 165, 250, 0.1);
            --insight-gradient: linear-gradient(135deg, #172554 0%, #1f2937 100%);
        }

html.theme-dark[data-accent="orange"] {
            --accent-primary: #fb923c;
            --accent-dark: #fdba74;
            --accent-mid: #f97316;
            --accent-soft: rgba(251, 146, 60, 0.18);
            --bg-primary-light: rgba(251, 146, 60, 0.18);
            --bg-primary-xlight: rgba(251, 146, 60, 0.1);
            --insight-gradient: linear-gradient(135deg, #431407 0%, #1f2937 100%);
        }

html.theme-dark[data-accent="purple"] {
            --accent-primary: #a78bfa;
            --accent-dark: #c4b5fd;
            --accent-mid: #8b5cf6;
            --accent-soft: rgba(167, 139, 250, 0.18);
            --bg-primary-light: rgba(167, 139, 250, 0.18);
            --bg-primary-xlight: rgba(167, 139, 250, 0.1);
            --insight-gradient: linear-gradient(135deg, #2e1065 0%, #1f2937 100%);
        }

html.theme-dark[data-accent="pink"] {
            --accent-primary: #f472b6;
            --accent-dark: #f9a8d4;
            --accent-mid: #ec4899;
            --accent-soft: rgba(244, 114, 182, 0.18);
            --bg-primary-light: rgba(244, 114, 182, 0.18);
            --bg-primary-xlight: rgba(244, 114, 182, 0.1);
            --insight-gradient: linear-gradient(135deg, #500724 0%, #1f2937 100%);
        }

        html.theme-dark body {
            background-color: var(--bg-main);
            color: var(--text-main);
        }

        html.theme-dark .dash-card,
        html.theme-dark .auth-card,
        html.theme-dark .task-quick-card,
        html.theme-dark .tasks-search,
        html.theme-dark .tasks-view-toggle,
        html.theme-dark .control-btn,
        html.theme-dark .export-menu,
        html.theme-dark .date-picker-popover,
        html.theme-dark .confirm-dialog,
        html.theme-dark .mobile-nav-panel,
        html.theme-dark .quick-popover,
        html.theme-dark .task-status-select {
            background: var(--card-bg);
            border-color: var(--border-color);
            color: var(--text-main);
        }

        html.theme-dark .side-nav-item:hover,
        html.theme-dark .side-nav-item:focus-visible,
        html.theme-dark .side-nav-item.active {
            background: #2a303a;
            color: var(--text-main);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
        }

        html.theme-dark .side-nav-item::before,
        html.theme-dark .side-nav-item::after {
            background: var(--card-bg);
            border-color: var(--border-color);
            color: var(--text-main);
        }

        html.theme-dark .side-nav-item.active .material-symbols-rounded,
        html.theme-dark .nav-tab.active,
        html.theme-dark .nav-tab.active .material-symbols-rounded,
        html.theme-dark .mobile-nav-item.active,
        html.theme-dark .mobile-nav-item:hover,
        html.theme-dark .mobile-nav-item:focus-visible {
            color: var(--text-main);
        }

        html.theme-dark .nav-tab.active {
            background: var(--card-bg);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
        }

        html.theme-dark .mobile-nav-backdrop {
            background: rgba(0, 0, 0, 0.45);
        }

        html.theme-dark .dash-table th,
        html.theme-dark .dash-table td,
        html.theme-dark .device-table-row,
        html.theme-dark .task-list-item,
        html.theme-dark .task-row-details,
        html.theme-dark .kanban-task-card,
        html.theme-dark .ad-efficiency-metric,
        html.theme-dark .audience-kpi-item,
        html.theme-dark .season-category-card {
            background-color: var(--bg-secondary);
            border-color: var(--border-color);
            color: var(--text-main);
        }

        html.theme-dark .dash-table tr:hover td,
        html.theme-dark .quick-task-details,
        html.theme-dark .quick-popover input:focus,
        html.theme-dark .quick-popover textarea,
        html.theme-dark .quick-popover input,
        html.theme-dark .date-picker-grid button:hover {
            background: #20242d;
            color: var(--text-main);
        }

        html.theme-dark .text-muted,
        html.theme-dark .dash-card-subtitle,
        html.theme-dark .kpi-footer,
        html.theme-dark .task-description,
        html.theme-dark .task-meta {
            color: var(--text-secondary) !important;
        }

        html.theme-dark .border-top,
        html.theme-dark .border-bottom,
        html.theme-dark .border-start,
        html.theme-dark .border-end {
            border-color: var(--border-color) !important;
        }

        html.theme-dark .bg-white,
        html.theme-dark .bg-light {
            background-color: var(--card-bg) !important;
            color: var(--text-main) !important;
        }

        html.theme-dark .empty-tasks {
            background: rgba(255, 255, 255, 0.04);
            color: var(--text-secondary);
            border-color: var(--border-color);
        }

        html.theme-dark .insight-card {
            background: #1B1F27;
            color: var(--text-main);
        }

        html.theme-dark .insight-card .dash-card-title,
        html.theme-dark .insight-text {
            color: var(--text-main);
        }

        html.theme-dark .insight-btn {
            background: var(--accent-primary);
            color: #111827;
        }

        html.theme-dark .auth-switch button.active {
            background: var(--card-bg);
            color: var(--text-main);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
        }

        html.theme-dark .auth-field input,
        html.theme-dark .auth-password {
            background: #20242d;
            color: var(--text-main);
            border-color: var(--border-color);
        }

        html.theme-dark .auth-field input::placeholder {
            color: var(--text-muted);
        }

        html.theme-dark .tasks-list,
        html.theme-dark .task-list-item {
            background: var(--bg-secondary);
            border-color: var(--border-color);
        }

        html.theme-dark .task-list-item.is-done {
            background: rgba(255, 255, 255, 0.018);
            opacity: 1;
        }

        html.theme-dark .task-list-item.is-done .task-title {
            color: #9AA3AF;
        }

        html.theme-dark .task-check {
            appearance: none;
            width: 18px;
            height: 18px;
            border: 1px solid #5D6673;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.04);
            display: inline-grid;
            place-content: center;
        }

        html.theme-dark .task-check:checked {
            background: var(--accent-primary);
            border-color: var(--accent-primary);
        }

        html.theme-dark .task-check:checked::after {
            content: 'check';
            font-family: 'Material Symbols Rounded';
            color: #111827;
            font-size: 16px;
            font-weight: 700;
            line-height: 1;
        }

        html.theme-dark input,
        html.theme-dark textarea,
        html.theme-dark select {
            color-scheme: dark;
        }

        body.fullpage-capture-mode .side-navbar,
        body.fullpage-capture-mode .mobile-menu-toggle,
        body.fullpage-capture-mode .mobile-nav-panel,
        body.fullpage-capture-mode .mobile-nav-backdrop {
            position: absolute;
        }

        .auth-body {
            min-height: 100vh;
            padding: 0;
            background: var(--bg-main);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .auth-shell {
            width: 100%;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }

        .auth-card {
            width: min(100%, 420px);
            background: #fff;
            border: 1px solid var(--border-color);
            border-radius: 16px;
            box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
            padding: 22px;
        }

        .auth-card *,
        .auth-card *::before,
        .auth-card *::after {
            box-sizing: border-box;
        }

        .auth-brand {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
        }

        .auth-brand-mark {
            width: 38px;
            height: 38px;
            border-radius: 12px;
            background: var(--accent-primary);
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .auth-brand-mark .material-symbols-rounded {
            font-size: 23px;
        }

        .auth-brand-title {
            color: var(--text-main);
            font-size: 17px;
            font-weight: 700;
            line-height: 1.2;
        }

        .auth-brand-subtitle {
            color: var(--text-muted);
            font-size: 13px;
            line-height: 1.35;
            margin-top: 2px;
        }

        .auth-switch {
            height: 42px;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 4px;
            padding: 4px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            background: var(--bg-secondary);
            margin-bottom: 22px;
        }

        .auth-switch button {
            border: 0;
            border-radius: 9px;
            background: transparent;
            color: var(--text-secondary);
            font: inherit;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
        }

        .auth-switch button.active {
            background: #fff;
            color: var(--text-main);
            box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
        }

        .auth-form {
            display: none;
        }

        .auth-form.active {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .auth-heading {
            margin-bottom: 2px;
        }

        .auth-heading h1 {
            margin: 0;
            color: var(--text-main);
            font-size: 28px;
            font-weight: 700;
            line-height: 1.15;
        }

        .auth-heading p {
            margin: 6px 0 0;
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.45;
        }

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

        .auth-field > span {
            color: var(--text-muted);
            font-size: 13px;
            font-weight: 700;
        }

        .auth-field input,
        .auth-password {
            width: 100%;
            min-height: 44px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            background: #fff;
            color: var(--text-main);
            transition: border-color 0.16s ease, box-shadow 0.16s ease;
        }

        .auth-field input {
            outline: 0;
            font: inherit;
            font-size: 15px;
            padding: 0 13px;
        }

        .auth-password {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 40px;
            align-items: center;
        }

        .auth-password input {
            min-height: 42px;
            border: 0;
            border-radius: 12px 0 0 12px;
        }

        .auth-password button {
            width: 40px;
            height: 40px;
            border: 0;
            border-radius: 10px;
            background: transparent;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .auth-password button:hover {
            color: var(--text-main);
            background: var(--bg-secondary);
        }

        .auth-field:focus-within > input,
        .auth-field:focus-within .auth-password {
            border-color: var(--border-color);
            box-shadow: none;
        }

        .auth-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-top: 2px;
        }

        .auth-check {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.35;
        }

        .auth-check input {
            width: 16px;
            height: 16px;
            accent-color: var(--accent-primary);
        }

        .auth-link {
            border: 0;
            background: transparent;
            color: var(--accent-dark);
            font: inherit;
            font-size: 14px;
            font-weight: 700;
            padding: 0;
            cursor: pointer;
            text-decoration: none;
        }

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

        .auth-terms {
            align-items: flex-start;
            margin-top: 2px;
        }

        .auth-submit {
            height: 44px;
            border: 0;
            border-radius: 12px;
            background: var(--accent-primary);
            color: #202124;
            font: inherit;
            font-size: 15px;
            font-weight: 800;
            cursor: pointer;
            margin-top: 4px;
            transition: transform 0.16s ease, filter 0.16s ease;
        }

        .auth-submit:hover {
            filter: brightness(0.98);
        }

        .auth-submit:active {
            transform: scale(0.99);
        }

        .auth-footer-link {
            display: flex;
            justify-content: center;
            margin-top: 2px;
        }

        .auth-error {
            min-height: 18px;
            color: var(--negative);
            font-size: 13px;
            font-weight: 600;
            line-height: 1.35;
        }

        @media (max-width: 520px) {
            .auth-shell {
                align-items: flex-start;
                padding: 14px;
            }

            .auth-card {
                border-radius: 14px;
                padding: 18px;
                margin-top: 24px;
            }

            .auth-heading h1 {
                font-size: 25px;
            }
        }

        html {
            overflow-y: scroll;
            scrollbar-gutter: stable both-edges;
        }

        body {
            font-family: 'Manrope', sans-serif;
            background-color: var(--bg-main);
            color: var(--text-main);
            font-size: 19.5px;
            font-weight: 400;
            font-variant-numeric: tabular-nums;
            margin: 0;
            padding: 0;
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
        }

        @media (min-width: 1024px) {
            body {
                padding-left: 76px;
            }
        }

        body.is-loading {
            overflow: hidden;
        }

        .page-preloader {
            position: fixed;
            inset: 0;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 16px;
            background: var(--bg-main);
            color: var(--text-main);
            opacity: 1;
            visibility: visible;
            transition: opacity 0.45s ease, visibility 0.45s ease;
        }

        .modal-backdrop {
            z-index: 9400;
        }

        .modal {
            z-index: 9600;
        }

        body.is-loaded .page-preloader {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .preloader-spinner {
            width: 42px;
            height: 42px;
            border: 4px solid var(--accent-soft);
            border-top-color: var(--accent-primary);
            border-radius: 50%;
            animation: preloaderSpin 0.8s linear infinite;
        }

        .app-container {
            opacity: 1;
            transform: translateY(0);
        }

        body.is-loading .app-container {
            opacity: 1;
            transform: none;
        }

        @keyframes preloaderSpin {
            to { transform: rotate(360deg); }
        }

        @keyframes animate__slideInLeft {
            from {
                transform: translate3d(-100%, 0, 0);
                visibility: visible;
                opacity: 0;
            }
            to {
                transform: translate3d(0, 0, 0);
                opacity: 1;
            }
        }

        @keyframes animate__slideInDown {
            from {
                transform: translate3d(0, -100%, 0);
                visibility: visible;
                opacity: 0;
            }
            to {
                transform: translate3d(0, 0, 0);
                opacity: 1;
            }
        }

        @keyframes animate__slideInUp {
            from {
                transform: translate3d(0, 54px, 0);
                visibility: visible;
                opacity: 0;
            }
            to {
                transform: translate3d(0, 0, 0);
                opacity: 1;
            }
        }

        body.is-loading .side-navbar,
        body.is-loading .nav-tabs-container,
        body.is-loading .section-header,
        body.is-loading .tab-pane.active {
            opacity: 0;
            visibility: hidden;
        }

        body.intro-animate .side-navbar {
            animation: animate__slideInLeft 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
        }

        body.intro-animate .nav-tabs-container {
            animation: animate__slideInDown 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.58s both;
        }

        body.intro-animate .section-header {
            animation: animate__slideInUp 0.58s cubic-bezier(0.22, 1, 0.36, 1) 1.16s both;
        }

        body.intro-animate .tab-pane.active {
            animation: animate__slideInUp 0.64s cubic-bezier(0.22, 1, 0.36, 1) 1.74s both;
        }

        body.intro-complete .tab-pane.active {
            animation: none;
        }

        body.is-loading .budget-page,
        body.is-loading .tasks-page,
        body.is-loading .links-page,
        body.is-loading .settings-page {
            opacity: 0;
            visibility: hidden;
        }

        .text-primary {
            color: var(--accent-dark) !important;
        }

        .material-symbols-rounded {
            direction: ltr;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-family: 'Material Symbols Rounded';
            font-feature-settings: 'liga';
            font-size: 1em;
            font-style: normal;
            font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
            font-weight: normal;
            letter-spacing: normal;
            line-height: 1;
            text-transform: none;
            white-space: nowrap;
            word-wrap: normal;
            -webkit-font-smoothing: antialiased;
        }

        .side-navbar {
            position: fixed;
            top: 20px;
            left: var(--side-nav-left);
            bottom: 20px;
            z-index: 1200;
            width: 44px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            backdrop-filter: none;
            transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1);
            will-change: width;
        }

        .side-navbar.is-expanded {
            width: var(--side-nav-expanded-width);
            align-items: stretch;
        }

        .side-navbar-group {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .side-navbar.is-expanded .side-navbar-group {
            align-items: stretch;
        }

        .side-nav-item {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 42px;
            height: 42px;
            border: 0;
            border-radius: 14px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            overflow: visible;
            transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, width 0.24s cubic-bezier(0.22, 1, 0.36, 1), padding 0.24s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .side-navbar.is-expanded .side-nav-item {
            width: 100%;
            justify-content: flex-start;
            gap: 12px;
            padding: 0 12px;
        }

        .side-nav-item:hover,
        .side-nav-item:focus-visible {
            color: var(--text-main);
            background: var(--card-bg);
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
            outline: none;
        }

        .side-nav-item.active {
            color: var(--text-main);
            background: var(--card-bg);
        }

        .side-nav-item .material-symbols-rounded {
            order: 1;
            font-size: 27px;
            color: currentColor;
        }

        .side-nav-label {
            order: 2;
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            color: currentColor;
            font-size: 14px;
            font-weight: 700;
            line-height: 1;
            text-align: left;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transform: translateX(-6px);
            transition: opacity 0.14s ease, transform 0.18s ease, visibility 0s linear 0.18s;
        }

        .side-navbar.is-expanded .side-nav-label {
            opacity: 1;
            visibility: visible;
            transform: translateX(0);
            transition-delay: 0.08s, 0.08s, 0s;
        }

        .side-navbar.is-transitioning:not(.is-expanded) .side-nav-label {
            opacity: 0;
            visibility: hidden;
            transform: translateX(-6px);
            transition-delay: 0s;
        }

        .side-nav-item.active .material-symbols-rounded {
            color: currentColor;
        }

        .logout-nav-item,
        .logout-nav-item .material-symbols-rounded {
            color: var(--negative);
        }

        .logout-nav-item:hover,
        .logout-nav-item:focus-visible {
            color: var(--negative);
            background: rgba(229, 72, 77, 0.1);
        }

        .side-nav-item::before {
            content: attr(data-tooltip);
            position: absolute;
            left: calc(100% + 10px);
            top: 50%;
            z-index: 2;
            padding: 8px 10px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-main);
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
            font-size: 13px;
            font-weight: 600;
            line-height: 1;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transform: translate(-4px, -50%);
            transition: opacity 0.16s ease, transform 0.16s ease;
        }

        .side-nav-item::after {
            content: '';
            position: absolute;
            left: calc(100% + 6px);
            top: 50%;
            width: 8px;
            height: 8px;
            border-left: 1px solid var(--border-color);
            border-bottom: 1px solid var(--border-color);
            background: var(--card-bg);
            opacity: 0;
            pointer-events: none;
            transform: translate(-4px, -50%) rotate(45deg);
            transition: opacity 0.16s ease, transform 0.16s ease;
        }

        .side-nav-item:hover::before,
        .side-nav-item:hover::after,
        .side-nav-item:focus-visible::before,
        .side-nav-item:focus-visible::after {
            opacity: 1;
            transform: translate(0, -50%);
        }

        .side-navbar.is-transitioning .side-nav-item::before,
        .side-navbar.is-transitioning .side-nav-item::after,
        .side-navbar.is-expanded .side-nav-item::before,
        .side-navbar.is-expanded .side-nav-item::after,
        .side-navbar.is-expanded .side-nav-item:hover::before,
        .side-navbar.is-expanded .side-nav-item:hover::after,
        .side-navbar.is-expanded .side-nav-item:focus-visible::before,
        .side-navbar.is-expanded .side-nav-item:focus-visible::after {
            pointer-events: none;
            opacity: 0;
            transform: none;
        }

        .mobile-menu-toggle,
        .mobile-nav-backdrop,
        .mobile-nav-panel {
            display: none;
        }

        /* Strict Corporate SaaS adjustments (Stripe/Linear inspired) */
        .app-container {
            width: auto;
            max-width: 1600px;
            margin: 0 20px 0 var(--side-nav-content-offset);
            padding: 16px 20px 28px;
            transition: margin-left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
        }

        body.side-nav-expanded .app-container {
            margin-left: var(--side-nav-content-offset-expanded);
        }

        @media (min-width: 1440px) {
            .app-container { padding: 20px 28px 32px; }
        }

        @media (max-width: 1800px) {
            .app-container {
                max-width: none;
            }
        }

        @media (max-width: 1023px) {
            .side-navbar {
                display: none;
            }

            .app-container {
                width: 100%;
                max-width: none;
                margin: 0;
            }

            body.side-nav-expanded .app-container {
                margin: 0;
            }

            .mobile-menu-toggle {
                position: fixed;
                right: 16px;
                bottom: 16px;
                z-index: 1301;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 54px;
                height: 54px;
                border: 1px solid rgba(15, 23, 42, 0.08);
                border-radius: 16px;
                background: var(--accent-primary);
                color: #000000;
                box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
                cursor: pointer;
            }

            .mobile-menu-toggle .material-symbols-rounded {
                font-size: 30px;
                color: currentColor;
            }

            .mobile-nav-backdrop {
                position: fixed;
                inset: 0;
                z-index: 1298;
                display: block;
                background: rgba(15, 23, 42, 0.18);
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.18s ease;
            }

            .mobile-nav-panel {
                position: fixed;
                right: 16px;
                bottom: 82px;
                z-index: 1300;
                display: grid;
                width: min(260px, calc(100vw - 32px));
                padding: 8px;
                border: 1px solid var(--border-color);
                border-radius: 16px;
                background: rgba(255, 255, 255, 0.98);
                box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
                opacity: 0;
                pointer-events: none;
                transform: translateY(10px);
                transition: opacity 0.18s ease, transform 0.18s ease;
            }

            .mobile-nav-item {
                display: flex;
                align-items: center;
                gap: 10px;
                width: 100%;
                min-height: 44px;
                padding: 10px;
                border: 0;
                border-radius: 12px;
                background: transparent;
                color: var(--text-secondary);
                font: inherit;
                font-size: 15px;
                font-weight: 700;
                text-align: left;
                cursor: pointer;
            }

            .mobile-nav-item .material-symbols-rounded {
                font-size: 24px;
                color: currentColor;
            }

            .mobile-nav-item.active,
            .mobile-nav-item:hover,
            .mobile-nav-item:focus-visible {
                background: var(--card-bg);
                color: #000000;
                outline: none;
            }

            body.mobile-nav-open .mobile-nav-backdrop {
                opacity: 1;
                pointer-events: auto;
            }

            body.mobile-nav-open .mobile-nav-panel {
                opacity: 1;
                pointer-events: auto;
                transform: translateY(0);
            }
        }

        /* Header */
        .top-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 64px;
            background: transparent;
            margin-bottom: 12px;
        }

        .search-container {
            position: relative;
            width: 300px;
        }

        .search-container input {
            width: 100%;
            height: 40px;
            padding: 8px 16px 8px 40px;
            border-radius: 18px;
            border: 1px solid var(--border-color);
            background: var(--card-bg);
            font-family: 'Manrope', sans-serif;
            font-size: 19.5px;
            color: var(--text-main);
            box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
            outline: none;
            transition: border-color 0.2s;
        }

        .search-container input:focus { border-color: var(--border-color); box-shadow: none; }
        .search-container i {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 24px;
        }

        .user-panel {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .btn-icon {
            width: 36px;
            height: 36px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background: var(--card-bg);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-icon:hover {
            color: var(--text-main);
            border-color: var(--border-color);
            background: var(--bg-secondary);
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
        }

        .avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--bg-primary-light);
            color: var(--accent-dark);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 21px;
        }

        .user-info { display: flex; flex-direction: column; }
        .user-name { font-weight: 600; font-size: 19.5px; }
        .user-role { color: var(--text-secondary); font-size: 18px; }

        /* Tabs */
        .nav-tabs-container {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding-bottom: 4px;
            margin-bottom: 24px;
        }
        .nav-tabs-container::-webkit-scrollbar { display: none; }

        .nav-tab {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 8px 16px;
            border-radius: 10px;
            color: var(--text-secondary);
            font-weight: 500;
            font-size: 16px;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
            border: none;
            background: transparent;
        }

        .nav-tab .material-symbols-rounded {
            font-size: 21px;
            line-height: 1;
            color: currentColor;
        }

        .nav-tab:hover { color: var(--text-main); }
        .nav-tab.active {
            color: #000000;
            background: var(--card-bg);
            font-weight: 600;
        }

        /* Section Header */
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            height: 70px;
        }

        .budget-page,
        .tasks-page,
        .links-page,
        .settings-page {
            display: none;
        }

        body.app-section-budgets .nav-tabs-container,
        body.app-section-budgets .section-header,
        body.app-section-budgets .tab-pane,
        body.app-section-tasks .nav-tabs-container,
        body.app-section-tasks .section-header,
        body.app-section-tasks .tab-pane,
        body.app-section-links .nav-tabs-container,
        body.app-section-links .section-header,
        body.app-section-links .tab-pane,
        body.app-section-settings .nav-tabs-container,
        body.app-section-settings .section-header,
        body.app-section-settings .tab-pane {
            display: none !important;
        }

        body.app-section-budgets .budget-page {
            display: block;
        }

        body.app-section-tasks .tasks-page {
            display: block;
        }

        body.app-section-links .links-page {
            display: block;
        }

        body.app-section-settings .settings-page {
            display: block;
        }

        body.intro-animate.app-section-budgets .budget-page {
            animation: animate__slideInUp 0.64s cubic-bezier(0.22, 1, 0.36, 1) 1.74s both;
        }

        body.intro-animate.app-section-tasks .tasks-page {
            animation: animate__slideInUp 0.64s cubic-bezier(0.22, 1, 0.36, 1) 1.74s both;
        }

        body.intro-animate.app-section-links .links-page {
            animation: animate__slideInUp 0.64s cubic-bezier(0.22, 1, 0.36, 1) 1.74s both;
        }

        body.intro-animate.app-section-settings .settings-page {
            animation: animate__slideInUp 0.64s cubic-bezier(0.22, 1, 0.36, 1) 1.74s both;
        }

        .budget-page-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 20px;
            margin-bottom: 24px;
        }

        .budget-page-header .section-title h1 {
            margin: 0;
            font-size: 44px;
            font-weight: 700;
            line-height: 1.08;
            letter-spacing: 0;
        }

        .budget-page-header .section-title p {
            margin: 8px 0 0;
            color: var(--text-secondary);
            font-size: 20px;
            line-height: 1.35;
        }

        .tasks-page-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 22px;
            margin-bottom: 24px;
        }

        .tasks-page-header .section-title h1 {
            margin: 0;
            font-size: 44px;
            font-weight: 700;
            line-height: 1.08;
            letter-spacing: 0;
        }

        .tasks-page-header .section-title p {
            margin: 8px 0 0;
            color: var(--text-secondary);
            font-size: 20px;
            line-height: 1.35;
        }

        .links-page-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 22px;
            margin-bottom: 24px;
        }

        .links-page-header .section-title h1 {
            margin: 0;
            font-size: 44px;
            font-weight: 700;
            line-height: 1.08;
            letter-spacing: 0;
        }

        .links-page-header .section-title p {
            margin: 8px 0 0;
            color: var(--text-secondary);
            font-size: 20px;
            line-height: 1.35;
        }

        .links-header-actions {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
        }

        .links-board {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 18px;
            align-items: start;
        }

        .links-category {
            min-width: 0;
            border: 1px solid var(--border-color);
            border-radius: 16px;
            background: var(--card-bg);
            padding: 16px;
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.02);
        }

        .links-category-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
        }

        .links-category-head h2 {
            margin: 0;
            color: var(--text-main);
            font-size: 21px;
            font-weight: 700;
            line-height: 1.2;
        }

        .links-category-head p {
            margin: 5px 0 0;
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.35;
        }

        .links-count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 30px;
            height: 28px;
            border-radius: 999px;
            background: var(--accent-soft);
            color: var(--text-main);
            font-size: 14px;
            font-weight: 700;
        }

        .link-card {
            display: grid;
            grid-template-columns: 42px minmax(0, 1fr) auto;
            gap: 12px;
            align-items: start;
            padding: 14px 0;
            border-top: 1px solid var(--border-color);
        }

        .link-card:first-of-type {
            border-top: none;
            padding-top: 0;
        }

        .link-card:last-child {
            padding-bottom: 0;
        }

        .link-logo {
            width: 42px;
            height: 42px;
            object-fit: contain;
            border-radius: 10px;
            background: var(--page-bg);
            border: 1px solid var(--border-color);
            padding: 6px;
        }

        .link-card-content {
            min-width: 0;
        }

        .link-category-name {
            margin-bottom: 3px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
            line-height: 1.2;
            text-transform: uppercase;
        }

        .link-card h3 {
            margin: 0;
            color: var(--text-main);
            font-size: 17px;
            font-weight: 700;
            line-height: 1.25;
        }

        .link-card p {
            margin: 5px 0 0;
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.35;
        }

        .link-card-actions {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .link-icon-btn {
            width: 34px;
            height: 34px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            display: inline-grid;
            place-items: center;
            background: var(--page-bg);
            color: var(--text-secondary);
            cursor: pointer;
            text-decoration: none;
            transition: all 0.2s;
        }

        .link-icon-btn:hover,
        .link-icon-btn:focus-visible {
            color: var(--text-main);
            background: var(--bg-secondary);
        }

        .link-icon-btn .material-symbols-rounded {
            font-size: 19px;
            line-height: 1;
        }

        html.theme-dark .links-category {
            background: var(--card-bg);
            border-color: var(--border-color);
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.02);
        }

        html.theme-dark .link-card {
            border-color: var(--border-color);
        }

        html.theme-dark .link-logo,
        html.theme-dark .link-icon-btn {
            background: var(--bg-secondary);
            border-color: var(--border-color);
            color: var(--text-secondary);
        }

        html.theme-dark .link-icon-btn:hover,
        html.theme-dark .link-icon-btn:focus-visible {
            background: #20242d;
            border-color: var(--border-color);
            color: var(--text-main);
        }

        .settings-tabs-container {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding-bottom: 4px;
            margin-bottom: 24px;
            scrollbar-width: none;
        }

        .settings-tabs-container::-webkit-scrollbar { display: none; }

        .settings-tab {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 8px 16px;
            border-radius: 10px;
            color: var(--text-secondary);
            font-weight: 500;
            font-size: 16px;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
            border: none;
            background: transparent;
        }

        .settings-tab .material-symbols-rounded {
            font-size: 21px;
            line-height: 1;
            color: currentColor;
        }

        .settings-tab:hover { color: var(--text-main); }
        .settings-tab.active {
            color: #000000;
            background: var(--card-bg);
            font-weight: 600;
        }

        html.theme-dark .settings-tab.active,
        html.theme-dark .settings-tab.active .material-symbols-rounded {
            color: var(--text-main);
        }

        html.theme-dark .settings-tab.active {
            background: var(--card-bg);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
        }

        .settings-tab-pane {
            display: none;
        }

        .settings-tab-pane.active {
            display: block;
        }

        .settings-page-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 22px;
            margin-bottom: 24px;
        }

        .settings-page-header .section-title h1 {
            margin: 0;
            font-size: 44px;
            font-weight: 700;
            line-height: 1.08;
            letter-spacing: 0;
        }

        .settings-page-header .section-title p {
            margin: 8px 0 0;
            color: var(--text-secondary);
            font-size: 20px;
            line-height: 1.35;
        }

        .settings-page .dash-card {
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.02);
        }

        .settings-layout {
            display: grid;
            grid-template-columns: minmax(220px, 300px) 1fr;
            gap: 20px;
            align-items: start;
        }

        .settings-profile-forms {
            grid-column: 2;
            display: grid;
            gap: 20px;
        }

        .settings-avatar-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            text-align: center;
        }

        .settings-avatar {
            width: 112px;
            height: 112px;
            border-radius: 50%;
            display: grid;
            place-items: center;
            background:#d8d8d8;
            border: 4px solid var(--card-bg);
            color: #111827;
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.02);
        }

        .settings-avatar-initials {
            font-size: 34px;
            line-height: 1;
            font-weight: 800;
            letter-spacing: 0;
        }

        .settings-avatar-name {
            margin-top: -4px;
            color: var(--text-main);
            font-size: 18px;
            font-weight: 700;
            line-height: 1.25;
        }

        .settings-accent-field {
            width: 100%;
            margin-top: 4px;
            text-align: left;
        }

        .settings-accent-field select {
            border-left: 5px solid var(--accent-primary);
        }

        .settings-form-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 16px;
        }

        .settings-form-grid.compact {
            gap: 12px;
        }

        .chart-container {
            position: relative;
        }

        .chart-container.chart-container-empty canvas {
            opacity: 0.08;
        }

        .chart-container.chart-container-empty::after {
            content: attr(data-empty-label);
            position: absolute;
            inset: 0;
            display: grid;
            place-items: center;
            padding: 20px;
            color: var(--text-secondary);
            font-size: 15px;
            font-weight: 700;
            text-align: center;
            pointer-events: none;
        }

        .settings-field {
            display: flex;
            flex-direction: column;
            gap: 8px;
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 600;
        }

        .settings-field input,
        .settings-field select,
        .settings-field textarea {
            width: 100%;
            min-height: 44px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            background: var(--page-bg);
            color: var(--text-main);
            padding: 10px 12px;
            font: inherit;
            outline: none;
        }

        .settings-field input:focus,
        .settings-field select:focus,
        .settings-field textarea:focus {
            border-color: var(--border-color);
            box-shadow: none;
        }

        .settings-actions {
            display: flex;
            justify-content: flex-end;
            margin-top: 18px;
        }

        .control-btn.primary {
            border-color: var(--accent);
            background: var(--accent);
            color: #111827;
            font-weight: 700;
        }

        .control-btn.primary .material-symbols-rounded {
            color: currentColor;
        }

        .settings-integrations-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 20px;
        }

        .integration-card {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .integration-card-head {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .integration-field-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: start;
            gap: 10px;
            min-width: 0;
        }

        .integration-field-row .settings-field {
            min-width: 0;
        }

        .integration-field-row .settings-user-action {
            margin-top: 28px;
        }

        .integration-card-skeleton {
            min-height: 248px;
            pointer-events: none;
        }

        .skeleton-copy {
            display: flex;
            flex: 1 1 auto;
            min-width: 0;
            flex-direction: column;
            gap: 10px;
        }

        .skeleton-block {
            position: relative;
            display: block;
            overflow: hidden;
            border-radius: 10px;
            background: color-mix(in srgb, var(--text-muted) 15%, var(--card-bg));
        }

        .skeleton-block::after {
            content: '';
            position: absolute;
            inset: 0;
            transform: translateX(-100%);
            background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card-bg) 72%, transparent), transparent);
            animation: skeletonShimmer 1.25s ease-in-out infinite;
        }

        .skeleton-logo {
            width: 64px;
            height: 64px;
            border-radius: 12px;
            flex: 0 0 auto;
        }

        .skeleton-title {
            width: min(220px, 70%);
            height: 24px;
        }

        .skeleton-line {
            width: 100%;
            height: 14px;
        }

        .skeleton-line.short {
            width: min(280px, 82%);
        }

        .skeleton-pill {
            width: 96px;
            height: 28px;
            border-radius: 999px;
        }

        .skeleton-input {
            height: 44px;
        }

        .skeleton-button {
            width: 126px;
            height: 38px;
        }

        .skeleton-button.wide {
            width: 210px;
        }

        @keyframes skeletonShimmer {
            100% {
                transform: translateX(100%);
            }
        }

        .integration-logo-wrap {
            width: 64px;
            height: 64px;
            border-radius: 12px;
            display: grid;
            place-items: center;
            background: #ffffff;
            border: 1px solid var(--border-color);
            padding: 10px;
            flex-shrink: 0;
        }

        .integration-logo-wrap.light-logo-tile {
            padding: 9px;
            background: #ffffff;
        }

        .integration-logo {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .integration-logo.wide {
            width: 100%;
            height: auto;
            max-height: 40px;
        }

        .access-table-wrap {
            overflow-x: auto;
        }

        .settings-users-table {
            min-width: 860px;
        }

        .settings-status {
            display: inline-flex;
            align-items: center;
            min-height: 26px;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 13px;
            font-weight: 700;
        }

        .settings-status.active {
            color: #166534;
            background: rgba(34, 197, 94, 0.16);
        }

        .settings-status.muted {
            color: var(--text-secondary);
            background: rgba(148, 163, 184, 0.16);
        }

        .settings-user-actions {
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .settings-user-action {
            width: 34px;
            height: 34px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            display: inline-grid;
            place-items: center;
            background: var(--page-bg);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s;
        }

        .settings-user-action:hover,
        .settings-user-action:focus-visible {
            color: var(--text-main);
            background: var(--bg-secondary);
        }

        .settings-user-action.danger:hover,
        .settings-user-action.danger:focus-visible {
            border-color: rgba(239, 68, 68, 0.55);
            color: #ef4444;
            background: rgba(239, 68, 68, 0.12);
        }

        .settings-user-action .material-symbols-rounded {
            font-size: 19px;
            line-height: 1;
        }

        html.theme-dark .settings-field input,
        html.theme-dark .settings-field select,
        html.theme-dark .settings-field textarea {
            background: var(--bg-secondary);
            border-color: var(--border-color);
            color: var(--text-main);
        }

        html.theme-dark .settings-field input::placeholder,
        html.theme-dark .settings-field textarea::placeholder {
            color: var(--text-muted);
        }

        html.theme-dark .settings-status.active {
            color: var(--positive);
            background: rgba(34, 197, 94, 0.18);
        }

        html.theme-dark .settings-avatar {
            border-color: var(--card-bg);
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.02);
        }

        html.theme-dark .integration-logo-wrap,
        html.theme-dark .settings-user-action {
            background: var(--bg-secondary);
            border-color: var(--border-color);
            color: var(--text-secondary);
        }

        html.theme-dark .integration-logo-wrap.light-logo-tile {
            background: #ffffff;
        }

        html.theme-dark .settings-user-action:hover,
        html.theme-dark .settings-user-action:focus-visible {
            background: #20242d;
            border-color: var(--border-color);
            color: var(--text-main);
        }

        .tasks-toolbar {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .tasks-search {
            min-width: 300px;
            height: 42px;
            display: flex;
            align-items: center;
            gap: 8px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            background: #fff;
            padding: 0 12px;
            color: var(--text-muted);
        }

        .tasks-search input {
            width: 100%;
            border: 0;
            outline: 0;
            background: transparent;
            color: var(--text-main);
            font: inherit;
            font-size: 16px;
        }

        .tasks-view-toggle {
            height: 42px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            background: #fff;
            padding: 4px;
        }

        .tasks-view-toggle button {
            height: 32px;
            border: 0;
            border-radius: 9px;
            background: transparent;
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0 12px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
        }

        .tasks-view-toggle button.active {
            background: var(--accent-primary);
            color: #202124;
            box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
        }

        .tasks-view-toggle .material-symbols-rounded {
            font-size: 19px;
        }

        .task-quick-card {
            margin: 0 0 14px;
            background: #fff;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            box-shadow: none;
            padding: 0;
            overflow: visible;
        }

        .task-form {
            position: relative;
        }

        .quick-task-line {
            display: grid;
            grid-template-columns: 24px minmax(0, 1fr) 34px;
            align-items: center;
            gap: 10px;
            min-height: 46px;
            padding: 0 10px;
        }

        .quick-task-check {
            width: 18px;
            height: 18px;
            border: 1.5px solid var(--text-muted);
            border-radius: 5px;
            background: #fff;
        }

        .quick-task-line input {
            width: 100%;
            border: 0;
            outline: 0;
            background: transparent;
            color: var(--text-main);
            font: inherit;
            font-size: 16px;
            font-weight: 500;
        }

        .quick-task-submit,
        .quick-action-btn,
        .task-detail-btn,
        .task-delete-btn {
            border: 0;
            background: transparent;
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .quick-task-submit {
            width: 30px;
            height: 30px;
            border-radius: 8px;
        }

        .quick-task-submit:hover,
        .quick-action-btn:hover,
        .task-detail-btn:hover,
        .task-delete-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-main);
        }

        .quick-task-details {
            border-top: 1px solid var(--border-color);
            padding: 7px 42px 8px 44px;
            background: #fafafa;
            border-radius: 0 0 12px 12px;
        }

        .quick-popover textarea {
            width: 100%;
            min-height: 96px;
            max-height: 160px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            outline: 0;
            resize: vertical;
            background: #fff;
            color: var(--text-main);
            font: inherit;
            font-size: 15px;
            line-height: 1.4;
            padding: 9px 10px;
        }

        .quick-task-meta {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-wrap: wrap;
        }

        .quick-action-wrap {
            position: relative;
        }

        .quick-action-btn {
            height: 30px;
            gap: 6px;
            border-radius: 8px;
            padding: 0 8px;
            font-size: 14px;
            font-weight: 500;
        }

        .quick-action-btn .material-symbols-rounded {
            font-size: 19px;
        }

        .quick-popover {
            position: absolute;
            left: 0;
            top: calc(100% + 6px);
            z-index: 30;
            min-width: 180px;
            display: none;
            flex-direction: column;
            gap: 4px;
            padding: 8px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            background: #fff;
            box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
        }

        .quick-popover-wide {
            min-width: 320px;
        }

        .quick-action-wrap.is-open .quick-popover {
            display: flex;
        }

        .quick-popover button,
        .quick-popover input {
            width: 100%;
            min-height: 34px;
            border: 0;
            border-radius: 8px;
            background: transparent;
            color: var(--text-main);
            text-align: left;
            font: inherit;
            font-size: 14px;
            padding: 6px 9px;
            outline: 0;
        }

        .quick-popover button:hover,
        .quick-popover input:focus {
            background: var(--bg-secondary);
        }

        .tasks-view-panel {
            display: none;
        }

        .tasks-view-panel.active {
            display: block;
        }

        .tasks-list {
            display: flex;
            flex-direction: column;
            gap: 0;
            background: #fff;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            overflow: hidden;
        }

        .task-list-item {
            display: block;
            background: #fff;
            border-bottom: 1px solid var(--border-color);
            box-shadow: none;
            padding: 0;
        }

        .task-list-item:last-child {
            border-bottom: 0;
        }

        .task-row-main {
            display: grid;
            grid-template-columns: 24px minmax(0, 1fr) 34px;
            align-items: center;
            gap: 10px;
            min-height: 44px;
            padding: 0 10px;
        }

        .task-check {
            width: 18px;
            height: 18px;
            accent-color: var(--accent-primary);
            cursor: pointer;
        }

        .task-title {
            font-size: 15.5px;
            font-weight: 500;
            color: var(--text-main);
            line-height: 1.3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .task-description {
            color: var(--text-secondary);
            font-size: 13.5px;
            line-height: 1.35;
            margin-bottom: 8px;
        }

        .task-meta {
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1.3;
        }

        .task-meta b {
            display: block;
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 2px;
        }

        .task-row-details {
            display: none;
            margin: 0 10px 10px 44px;
            padding: 10px 12px;
            border-radius: 10px;
            background: #fafafa;
        }

        .task-list-item.is-expanded .task-row-details {
            display: block;
        }

        .task-detail-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr)) 150px auto;
            gap: 10px;
            align-items: end;
        }

        .task-priority {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 28px;
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 13px;
            font-weight: 700;
            white-space: nowrap;
        }

        .task-priority.high {
            background: rgba(229, 72, 77, 0.1);
            color: var(--negative);
        }

        .task-priority.medium {
            background: var(--accent-soft);
            color: var(--accent-dark);
        }

        .task-priority.low {
            background: rgba(34, 160, 107, 0.1);
            color: var(--positive);
        }

        .task-status-select {
            width: 100%;
            min-height: 32px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: #fff;
            color: var(--text-main);
            font-size: 13px;
            outline: 0;
            padding: 4px 8px;
        }

        .task-detail-btn,
        .task-delete-btn {
            width: 30px;
            height: 30px;
            border-radius: 8px;
        }

        .task-delete-btn:active {
            transform: scale(0.94);
        }

        .task-detail-btn .material-symbols-rounded,
        .task-delete-btn .material-symbols-rounded {
            font-size: 19px;
        }

        .task-list-item.is-done {
            opacity: 0.68;
        }

        .task-list-item.is-done .task-title {
            text-decoration: line-through;
        }

        .kanban-board {
            display: flex;
            gap: 0;
            align-items: start;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 0 0 10px;
            min-height: clamp(540px, calc(100vh - 260px), 820px);
            scrollbar-width: none;
            scrollbar-gutter: stable;
            scroll-snap-type: x proximity;
        }

        .kanban-board::-webkit-scrollbar {
            display: none;
        }

        .kanban-column {
            flex: 0 0 254px;
            width: 254px;
            min-height: 540px;
            background: transparent;
            border: 0;
            border-right: 1px solid var(--border-color);
            border-radius: 0;
            box-shadow: none;
            padding: 0 8px 12px;
            scroll-snap-align: start;
        }

        .kanban-column:first-child {
            padding-left: 0;
        }

        .kanban-column-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            min-height: 42px;
            margin-bottom: 6px;
            padding: 0 8px;
        }

        .kanban-column-title {
            color: var(--text-main);
            font-size: 16px;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .kanban-column-actions {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            color: var(--text-secondary);
        }

        .kanban-column-actions button {
            width: 26px;
            height: 26px;
            border: 0;
            border-radius: 8px;
            background: transparent;
            color: inherit;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .kanban-column-actions button:hover {
            background: var(--bg-secondary);
            color: var(--text-main);
        }

        .kanban-column-actions .material-symbols-rounded {
            font-size: 19px;
        }

        .kanban-column-body {
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-height: 120px;
            border-radius: 8px;
            transition: background-color 0.16s ease, box-shadow 0.16s ease;
        }

        .kanban-column-body.is-drop-target {
            background: var(--accent-soft);
            box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-dark) 22%, transparent);
        }

        .kanban-task-card {
            position: relative;
            display: grid;
            grid-template-columns: 22px minmax(0, 1fr);
            align-items: start;
            gap: 10px;
            min-height: 86px;
            border: 0;
            border-left: 3px solid var(--accent-primary);
            border-radius: 7px;
            background: #ffffff;
            padding: 10px 10px 9px;
            box-shadow: none;
            cursor: grab;
            user-select: none;
            touch-action: none;
            transition: opacity 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
        }

        .kanban-task-card:active {
            cursor: grabbing;
        }

        .kanban-task-card.is-dragging {
            opacity: 0.55;
            transform: scale(0.98);
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
        }

        .kanban-task-card .task-title {
            white-space: normal;
            overflow: visible;
            text-overflow: clip;
            font-size: 15.5px;
            line-height: 1.35;
            font-weight: 500;
        }

        .kanban-task-card .task-check {
            margin-top: 2px;
        }

        .kanban-description-icon {
            grid-column: 2;
            color: var(--text-secondary);
            line-height: 1;
            margin-top: 4px;
        }

        .kanban-description-icon .material-symbols-rounded {
            font-size: 17px;
        }

        .empty-tasks {
            border: 1px dashed var(--border-color);
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.6);
            color: var(--text-muted);
            padding: 22px 12px;
            text-align: center;
            font-size: 14px;
        }

        .section-title h1 {
            font-size: 42px;
            font-weight: 600;
            margin: 0 0 4px 0;
            color: var(--text-main);
            letter-spacing: -0.5px;
        }

        .section-title p {
            font-size: 19.5px;
            color: var(--text-secondary);
            margin: 0;
        }

        .section-controls {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .control-btn {
            height: 36px;
            padding: 0 16px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background: var(--card-bg);
            color: var(--text-main);
            font-size: 16px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            flex-shrink: 0;
            white-space: nowrap;
            box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
        }

        .control-btn .material-symbols-rounded { color: var(--text-secondary); }
        .control-btn.icon-only { padding: 0; width: 36px; justify-content: center; }

        .export-menu-wrap {
            position: relative;
            flex-shrink: 0;
        }

        .export-menu {
            position: absolute;
            top: calc(100% + 10px);
            right: 0;
            z-index: 55;
            width: 210px;
            padding: 8px;
            border: 1px solid var(--border-color);
            border-radius: 14px;
            background: var(--card-bg);
            box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-6px);
            transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
        }

        .export-menu-wrap.open .export-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .export-menu-item {
            width: 100%;
            min-height: 42px;
            padding: 0 10px;
            border: 0;
            border-radius: 10px;
            background: transparent;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 16px;
            font-weight: 600;
            text-align: left;
            cursor: pointer;
        }

        .export-menu-item:hover {
            background: var(--bg-secondary);
        }

        .export-menu-item .material-symbols-rounded {
            color: var(--accent-dark);
            font-size: 22px;
        }

        .date-picker-wrap {
            position: relative;
            flex-shrink: 0;
        }

        .date-picker-popover {
            position: absolute;
            top: calc(100% + 10px);
            right: 0;
            z-index: 50;
            width: 320px;
            padding: 16px;
            border: 1px solid var(--border-color);
            border-radius: 16px;
            background: var(--card-bg);
            box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-6px);
            transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
        }

        .date-picker-wrap.open .date-picker-popover {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .date-picker-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
        }

        .date-picker-title {
            color: var(--text-main);
            font-size: 18px;
            font-weight: 700;
            text-align: center;
        }

        .date-picker-subtitle {
            color: var(--text-muted);
            font-size: 13px;
            text-align: center;
        }

        .date-nav-btn {
            width: 32px;
            height: 32px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .date-picker-weekdays,
        .date-picker-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 4px;
        }

        .date-picker-weekdays {
            margin-bottom: 6px;
        }

        .date-picker-weekdays span {
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 600;
            text-align: center;
        }

        .date-picker-grid button,
        .date-picker-grid span {
            width: 36px;
            height: 34px;
            border: 0;
            border-radius: 10px;
            background: var(--bg-secondary);
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 500;
        }

        .date-picker-grid button {
            cursor: pointer;
        }

        .date-picker-grid button:hover {
            background: var(--card-bg);
        }

        .date-picker-grid .muted {
            background: transparent;
            color: var(--text-muted);
        }

        .date-picker-grid .range-start,
        .date-picker-grid .range-end {
            background: var(--accent-primary);
            color: var(--text-main);
            font-weight: 700;
        }

        .date-picker-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            margin-top: 14px;
            padding-top: 14px;
            border-top: 1px solid var(--border-color);
            color: var(--text-secondary);
            font-size: 13px;
        }

        .date-apply-btn {
            height: 32px;
            padding: 0 14px;
            border: 0;
            border-radius: 10px;
            background: var(--accent-primary);
            color: var(--text-main);
            font-size: 13px;
            font-weight: 700;
        }

        /* Grid System */
        .grid {
            display: grid;
            grid-template-columns: repeat(12, minmax(0, 1fr));
            gap: 16px;
            margin-bottom: 16px;
        }
        
        .span-3 { grid-column: span 3; }
        .span-4 { grid-column: span 4; }
        .span-5 { grid-column: span 5; }
        .span-6 { grid-column: span 6; }
        .span-7 { grid-column: span 7; }
        .span-8 { grid-column: span 8; }
        .span-12 { grid-column: span 12; }

        .grid > [class*="span-"] {
            min-width: 0;
            width: auto;
            max-width: none;
        }

        /* Cards */
        .dash-card {
            background: var(--card-bg);
            border-radius: 16px;
            border: 1px solid rgba(17, 24, 39, 0.04);
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.02);
            padding: 20px;
            display: flex;
            flex-direction: column;
            position: relative;
        }

        .dash-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 16px;
            padding: 0;
            background: transparent;
            border: 0;
        }

        .dash-card-title-wrap {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .icon-box {
            width: 32px;
            height: 32px;
            border-radius: 10px;
            background: var(--bg-primary-light);
            color: var(--accent-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
        }

        .dash-card-title {
            font-size: 21px;
            font-weight: 600;
            color: var(--text-main);
        }

        .dash-card-subtitle {
            font-size: 14px;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .ad-efficiency-body {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 32px;
            flex: 1 1 auto;
            min-height: 170px;
        }

        .ad-efficiency-gauge {
            width: 230px;
            height: 138px;
            position: relative;
            flex: 0 0 230px;
        }

        .ad-efficiency-gauge-value {
            position: absolute;
            top: 60%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }

        .ad-efficiency-gauge-value > div {
            color: var(--text-main);
            font-size: 38px;
            font-weight: 700;
            white-space: nowrap;
        }

        .ad-efficiency-summary {
            min-width: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .ad-efficiency-metrics {
            display: flex;
            align-items: flex-start;
            gap: 28px;
            margin-top: 10px;
        }

        .ad-efficiency-metric {
            min-width: 0;
            font-size: 19px;
            white-space: nowrap;
        }

        /* KPI Values */
        #tab-overview > .grid:first-child .dash-card { min-height: 150px; }

        .kpi-value {
            font-size: 35px;
            font-weight: 600;
            color: var(--text-main);
            line-height: 1.1;
            margin: 8px 0;
            letter-spacing: -0.5px;
        }

        .kpi-footer {
            margin-top: auto;
            font-size: 16px;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .trend-badge {
            font-weight: 600;
            font-size: 18px;
        }
        .trend-badge.positive { color: var(--positive); }
        .trend-badge.negative { color: var(--negative); }

        /* Specific Cards */
        .insight-card {
            background: var(--insight-gradient);
            color: #fff;
            border: none;
            position: relative;
            overflow: hidden;
        }

        .insight-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background-image: radial-gradient(circle at 100% 0%, rgba(255,255,255,0.15) 0%, transparent 50%);
            pointer-events: none;
        }

        .insight-card .dash-card-title { color: #fff; font-size: 24px; }
        .insight-text {
            font-size: 21px;
            line-height: 1.5;
            margin: 16px 0;
            font-weight: 500;
            position: relative;
            z-index: 1;
        }

        .insight-btn {
            background: #fff;
            color: var(--accent-dark);
            border: none;
            border-radius: 10px;
            padding: 6px 16px;
            font-size: 18px;
            font-weight: 600;
            align-self: flex-start;
            cursor: pointer;
            position: relative;
            z-index: 1;
        }

        /* Charts */
        .chart-container {
            position: relative;
            width: 100%;
            flex-grow: 1;
            min-height: 220px;
        }

        canvas {
            cursor: crosshair;
        }

        /* Tables */
        .table-responsive { width: 100%; overflow-x: auto; }
        .dash-table {
            width: 100%;
            border-collapse: collapse;
            text-align: right;
            font-size: 15px;
            line-height: 1.35;
            font-variant-numeric: tabular-nums;
        }
        .dash-table th {
            color: var(--text-muted);
            font-weight: 600;
            font-size: 15px;
            line-height: 1.35;
            padding: 12px 10px;
            border-bottom: 1px solid var(--border-color);
            white-space: nowrap;
            vertical-align: middle;
        }
        .dash-table td {
            color: var(--text-main);
            font-size: 15px;
            line-height: 1.35;
            padding: 12px 10px;
            border-bottom: 1px solid var(--border-color);
            white-space: nowrap;
            vertical-align: middle;
        }
        .dash-table th:first-child, .dash-table td:first-child { text-align: left; }
        .dash-table tr:last-child td { border-bottom: none; }
        .dash-table tr:hover td { background-color: rgba(15, 23, 42, 0.025); }

        .sortable-heading {
            cursor: pointer;
            user-select: none;
            transition: color 0.16s ease, background-color 0.16s ease;
        }

        .sortable-heading::after {
            content: 'unfold_more';
            font-family: 'Material Symbols Rounded';
            font-size: 18px;
            font-weight: 400;
            line-height: 1;
            margin-left: 6px;
            vertical-align: -3px;
            color: #C2C7CE;
        }

        .sortable-heading:hover,
        .sortable-heading.sort-asc,
        .sortable-heading.sort-desc {
            color: var(--text-main);
            background-color: var(--bg-primary-xlight);
        }

        .sortable-heading.sort-asc::after {
            content: 'arrow_upward';
            color: var(--accent-dark);
        }

        .sortable-heading.sort-desc::after {
            content: 'arrow_downward';
            color: var(--accent-dark);
        }

        .campaign-table-wrap .dash-table {
            min-width: 1120px;
        }

        .campaign-table-wrap .dash-table th,
        .campaign-table-wrap .dash-table td {
            padding-left: 10px;
            padding-right: 10px;
        }

        .kpi-editor-card {
            min-height: 0;
        }

        .kpi-actions {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .kpi-table-wrap .dash-table {
            min-width: 0;
            table-layout: fixed;
        }

        .kpi-table th,
        .kpi-table td {
            font-size: 15px;
            line-height: 1.35;
            padding: 12px 10px;
            white-space: normal;
            overflow-wrap: anywhere;
        }

        .kpi-table th:first-child,
        .kpi-table td:first-child {
            width: 64px;
            text-align: center;
        }

        .kpi-table th:nth-child(2),
        .kpi-table td:nth-child(2) {
            text-align: left;
            width: 21%;
            overflow-wrap: normal;
        }

        .kpi-table th:nth-child(3),
        .kpi-table td:nth-child(3) {
            width: 18%;
        }

        .kpi-table th:nth-child(4),
        .kpi-table td:nth-child(4),
        .kpi-table th:nth-child(5),
        .kpi-table td:nth-child(5) {
            width: 12%;
        }

        .kpi-table th:nth-child(6),
        .kpi-table td:nth-child(6) {
            width: 13%;
        }

        .kpi-table th:nth-child(7),
        .kpi-table td:nth-child(7) {
            width: 9%;
        }

        .kpi-table th:nth-child(8),
        .kpi-table td:nth-child(8) {
            width: 72px;
            text-align: center;
        }

        .kpi-table td[contenteditable="true"] {
            border-radius: 6px;
            outline: none;
            transition: background-color 0.16s ease, box-shadow 0.16s ease;
        }

        .kpi-table td[contenteditable="true"]:focus {
            background: var(--bg-secondary);
            box-shadow: none;
        }

        .kpi-table tr.kpi-disabled td {
            color: var(--text-muted);
            opacity: 0.58;
        }

        .kpi-table tr.kpi-disabled td:not(:first-child) {
            background: rgba(245, 247, 250, 0.5);
        }

        html.theme-dark .kpi-table tr.kpi-disabled td {
            background: rgba(255, 255, 255, 0.018);
            color: #9AA3AF;
            opacity: 1;
        }

        html.theme-dark .kpi-table tr.kpi-disabled td:not(:first-child) {
            background: rgba(255, 255, 255, 0.018);
        }

        html.theme-dark .kpi-table tr.kpi-disabled td[contenteditable="true"] {
            border-radius: 0;
        }

        html.theme-dark .kpi-table tr.kpi-disabled td:not(:last-child) {
            border-right: 0;
        }

        html.theme-dark .kpi-table tr.kpi-disabled:hover td {
            background: rgba(255, 255, 255, 0.03);
            color: #B4BBC6;
        }

        .kpi-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            line-height: 1;
            vertical-align: middle;
        }

        .kpi-toggle input {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }

        .kpi-toggle span {
            position: relative;
            width: 42px;
            height: 24px;
            border-radius: 999px;
            background: #E9EDF2;
            box-shadow: inset 0 0 0 1px var(--border-color);
            transition: background-color 0.18s ease, box-shadow 0.18s ease;
        }

        .kpi-toggle span::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
            transition: transform 0.18s ease;
        }

        .kpi-toggle input:checked + span {
            background: var(--accent-primary);
            box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
        }

        .kpi-toggle input:checked + span::after {
            transform: translateX(18px);
        }

        .budget-table-wrap .dash-table {
            min-width: 1090px;
            table-layout: fixed;
        }

        .budget-table th,
        .budget-table td {
            font-size: 15px;
            line-height: 1.35;
            padding: 12px 10px;
        }

        .budget-table th:first-child,
        .budget-table td:first-child {
            width: 240px;
        }

        .budget-table th:nth-child(2),
        .budget-table td:nth-child(2) {
            width: 165px;
            text-align: left;
        }

        .budget-table th:nth-child(9),
        .budget-table td:nth-child(9) {
            width: 115px;
        }

        .budget-table th:last-child,
        .budget-table td:last-child {
            width: 52px;
            text-align: center;
        }

        .budget-table td[contenteditable="true"] {
            border-radius: 6px;
            outline: none;
            transition: background-color 0.16s ease, box-shadow 0.16s ease;
        }

        .budget-table td[contenteditable="true"]:focus {
            background: var(--bg-secondary);
            box-shadow: none;
        }

        .budget-row-total {
            color: var(--text-main);
            font-weight: 700;
            background: var(--bg-primary-xlight);
        }

        .budget-delete-row-btn {
            width: 34px;
            height: 34px;
            border: 0;
            border-radius: 10px;
            background: transparent;
            color: var(--text-muted);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
        }

        .budget-delete-row-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-main);
        }

        .budget-delete-row-btn:active {
            transform: scale(0.94);
        }

        .budget-delete-row-btn .material-symbols-rounded {
            font-size: 20px;
        }

        .kpi-row-delete-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 34px;
            height: 34px;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            background: var(--card-bg);
            color: var(--text-secondary);
            cursor: pointer;
            transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
        }

        .kpi-row-delete-btn:hover {
            background: var(--bg-secondary);
            border-color: var(--border-color);
            color: var(--text-main);
        }

        .kpi-row-delete-btn .material-symbols-rounded {
            font-size: 20px;
            line-height: 1;
        }

        @keyframes kpiZoomOutDown {
            40% {
                opacity: 1;
                transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -42px, 0);
                animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
            }
            100% {
                opacity: 0;
                transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 260px, 0);
                transform-origin: center bottom;
                animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
            }
        }

        .kpi-row-zoom-out-down {
            animation: kpiZoomOutDown 0.62s both;
            transform-origin: center bottom;
            will-change: opacity, transform;
        }

        .task-row-zoom-out-down {
            animation: kpiZoomOutDown 0.62s both;
            transform-origin: center bottom;
            will-change: opacity, transform;
        }

        .channel-cell {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            white-space: nowrap;
        }

        .channel-cell img {
            width: 24px;
            height: 24px;
            object-fit: contain;
            flex: 0 0 24px;
        }

        .season-category-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 16px;
        }

        .season-category-card {
            min-height: 170px;
            justify-content: space-between;
        }

        .season-category-top {
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
        }

        .season-category-title {
            color: var(--text-main);
            font-size: 20px;
            font-weight: 700;
            line-height: 1.25;
        }

        .season-category-growth {
            margin-top: 8px;
            color: var(--positive);
            font-size: 22px;
            font-weight: 700;
            line-height: 1.2;
        }

        .season-category-card p {
            margin: 18px 0 0;
            color: var(--text-secondary);
            font-size: 17px;
            line-height: 1.45;
        }

        .season-demand-chart {
            height: 390px;
        }

        .season-chart-scroll {
            width: 100%;
        }

        /* Progress bars */
        .progress-track {
            background: var(--bg-secondary);
            border-radius: 8px;
            height: 12px;
            width: 100%;
            overflow: hidden;
            margin-top: 8px;
        }
        .progress-fill {
            background: var(--accent-primary);
            height: 100%;
            border-radius: 8px;
        }

        .audience-kpi-strip {
            padding: 0;
            overflow: hidden;
        }

        .audience-kpi-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }

        .audience-kpi-item {
            min-width: 0;
            padding: 20px;
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--border-color);
        }

        .audience-kpi-item:last-child {
            border-right: 0;
        }

        #tab-audience .progress-track {
            height: 5px;
        }

        #tab-audience .audience-split-track {
            height: 5px;
        }

        .audience-device-layout {
            display: grid;
            grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
            gap: 28px;
            align-items: center;
            overflow: hidden;
        }

        .audience-device-layout > * {
            min-width: 0;
        }

        .audience-device-chart {
            height: 260px;
            min-height: 260px;
            width: 100%;
            max-width: 360px;
            margin: 0 auto;
            overflow: hidden;
        }

        .device-table {
            width: 100% !important;
            max-width: 100%;
            min-width: 0;
        }

        .device-table-row {
            display: grid;
            grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr) minmax(0, 0.8fr);
            align-items: center;
            border-bottom: 1px solid var(--border-color);
        }

        .device-table-row:last-child {
            border-bottom: 0;
        }

        .device-table-row > div {
            color: var(--text-main);
            font-size: 19.5px;
            padding: 14px 12px;
            white-space: normal;
        }

        .device-table-row > div:not(:first-child) {
            text-align: right;
        }

        .device-table-head > div {
            color: var(--text-muted);
            font-weight: 500;
            font-size: 18px;
            padding-top: 12px;
            padding-bottom: 12px;
        }

        .audience-split {
            display: flex;
            justify-content: space-between;
            gap: 16px;
            margin: 18px 0 12px;
        }

        .audience-split > div {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .audience-split > div:last-child {
            text-align: right;
        }

        .audience-split-label {
            color: var(--text-muted);
            font-size: 18px;
        }

        .audience-split strong {
            color: var(--text-main);
            font-size: 28px;
            font-weight: 600;
        }

        .audience-split-track {
            height: 14px;
        }

        .audience-insights {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .audience-insight-item {
            display: grid;
            grid-template-columns: 36px 1fr;
            gap: 14px;
            align-items: flex-start;
            color: var(--text-secondary);
            font-size: 18px;
            line-height: 1.45;
            text-align: left;
        }

        .audience-insight-item .material-symbols-rounded {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: var(--bg-primary-light);
            color: var(--accent-dark);
            font-size: 21px;
        }

        /* Utilities */
        .tab-pane { display: none; }
        .tab-pane.active { display: block; animation: fadeIn 0.3s ease-in-out; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

        .report-meta {
            display: none;
        }

        /* Print and PDF report mode */
        @page {
            size: A4 landscape;
            margin: 12mm;
        }

        @page reportPortrait {
            size: A4 portrait;
            margin: 12mm;
        }

        body.pdf-report-portrait {
            page: reportPortrait;
        }

        body.pdf-report-mode,
        body.pdf-report-mode * {
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }

        body.pdf-report-mode {
            background: #fff;
            overflow: visible;
        }

        body.pdf-report-mode .page-preloader,
        body.pdf-report-mode .top-header,
        body.pdf-report-mode .side-navbar,
        body.pdf-report-mode .nav-tabs-container,
        body.pdf-report-mode .section-controls,
        body.pdf-report-mode .date-picker-popover,
        body.pdf-report-mode .export-menu,
        body.pdf-report-mode .toast-container,
        body.pdf-report-mode .confirm-modal,
        body.pdf-report-mode .dash-card .control-btn,
        body.pdf-report-mode .dash-card button,
        body.pdf-report-mode .insight-btn {
            display: none !important;
        }

        body.pdf-report-mode .app-container {
            width: 1030px;
            max-width: 1030px;
            padding: 0;
            margin: 0;
            opacity: 1;
            transform: none;
        }

        body.pdf-report-mode.pdf-report-portrait .app-container {
            width: 703px;
            max-width: 703px;
        }

        body.pdf-report-mode .section-header {
            height: auto;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid #e5e7eb;
            align-items: flex-end;
        }

        body.pdf-report-mode .section-title h1 {
            font-size: 26px;
            line-height: 1.15;
            letter-spacing: 0;
            margin-bottom: 3px;
        }

        body.pdf-report-mode .section-title p {
            font-size: 12px;
            line-height: 1.35;
        }

        body.pdf-report-mode .report-meta {
            display: block;
            color: var(--text-secondary);
            font-size: 11px;
            line-height: 1.45;
            text-align: right;
            white-space: nowrap;
        }

        body.pdf-report-mode .tab-pane {
            display: none !important;
            animation: none !important;
            margin: 0;
            page-break-after: auto;
        }

        body.pdf-report-mode .tab-pane.active {
            display: block !important;
            width: 182%;
            zoom: 0.55;
        }

        body.pdf-report-mode .grid {
            gap: 10px;
            margin-bottom: 10px;
        }

        body.pdf-report-mode .dash-card {
            padding: 12px;
            border: 1px solid #e5e7eb;
            box-shadow: none;
            break-inside: avoid;
            page-break-inside: avoid;
        }

        body.pdf-report-mode .dash-card-header {
            margin-bottom: 8px;
        }

        body.pdf-report-mode .dash-card-title {
            font-size: 15px;
            line-height: 1.25;
        }

        body.pdf-report-mode .dash-card-subtitle {
            font-size: 11px;
            line-height: 1.3;
        }

        body.pdf-report-mode .icon-box {
            width: 24px;
            height: 24px;
            font-size: 18px;
        }

        body.pdf-report-mode .kpi-value {
            font-size: 30px;
            line-height: 1.05;
            margin: 4px 0;
        }

        body.pdf-report-mode .kpi-footer,
        body.pdf-report-mode .trend-badge {
            font-size: 11px;
        }

        body.pdf-report-mode .chart-container {
            min-height: 160px;
        }

        body.pdf-report-mode .table-responsive,
        body.pdf-report-mode .campaign-table-wrap {
            overflow: visible !important;
        }

        body.pdf-report-mode .dash-table {
            min-width: 0 !important;
            width: 100% !important;
            table-layout: auto;
        }

        body.pdf-report-mode .dash-table th,
        body.pdf-report-mode .dash-table td {
            font-size: 9px;
            line-height: 1.2;
            padding: 5px 4px;
            white-space: normal;
        }

        body.pdf-report-mode .sortable-heading {
            cursor: default;
        }

        body.pdf-report-mode .sortable-heading::after {
            display: none;
        }

        body.pdf-report-mode * {
            cursor: default !important;
        }

        body.pdf-report-mode .dash-table tr:hover td,
        body.pdf-report-mode .sortable-heading:hover {
            background-color: transparent;
        }

        body.pdf-report-mode .insight-card {
            box-shadow: none;
        }

        body.pdf-report-mode #tab-overview > .grid:first-child .dash-card {
            min-height: 0;
        }

        body.pdf-report-mode .ad-efficiency-body {
            min-height: 118px;
            gap: 18px;
        }

        body.pdf-report-mode .ad-efficiency-gauge {
            width: 170px;
            height: 102px;
            flex-basis: 170px;
        }

        body.pdf-report-mode .ad-efficiency-gauge-value > div {
            font-size: 28px;
        }

        body.pdf-report-mode .ad-efficiency-metric {
            font-size: 12px;
        }

        body.pdf-report-mode .insight-text {
            font-size: 14px;
            line-height: 1.35;
            margin: 8px 0;
        }

        body.pdf-report-mode .audience-kpi-item {
            padding: 12px;
        }

        body.pdf-report-mode .audience-device-chart {
            height: 190px;
            min-height: 190px;
            max-width: 240px;
        }

        body.pdf-report-mode .device-table-row > div {
            font-size: 12px;
            padding: 7px 6px;
        }

        body.pdf-report-mode .device-table-head > div {
            font-size: 11px;
        }

        body.pdf-report-mode .campaign-table-wrap .dash-table th,
        body.pdf-report-mode .campaign-table-wrap .dash-table td {
            font-size: 8px;
            padding: 4px 3px;
            line-height: 1.15;
        }

        @media print {
            body,
            body * {
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            body {
                background: #fff;
                overflow: visible;
            }

            .page-preloader,
            .top-header,
            .side-navbar,
            .nav-tabs-container,
            .section-controls,
            .date-picker-popover,
            .export-menu,
            .toast-container,
            .confirm-modal,
            .dash-card .control-btn,
            .dash-card button,
            .insight-btn {
                display: none !important;
            }

            .app-container {
                width: 100%;
                max-width: none;
                padding: 0;
                margin: 0;
                opacity: 1;
                transform: none;
            }

            .section-header {
                height: auto;
                margin-bottom: 12px;
                padding-bottom: 10px;
                border-bottom: 1px solid #e5e7eb;
                align-items: flex-end;
            }

            .section-title h1 {
                font-size: 26px;
                line-height: 1.15;
                letter-spacing: 0;
                margin-bottom: 3px;
            }

            .section-title p {
                font-size: 12px;
                line-height: 1.35;
            }

            .report-meta {
                display: block;
                color: var(--text-secondary);
                font-size: 11px;
                line-height: 1.45;
                text-align: right;
                white-space: nowrap;
            }

            .tab-pane {
                display: none !important;
                animation: none !important;
                margin: 0;
                page-break-after: auto;
            }

            .tab-pane.active {
                display: block !important;
                width: 182%;
                zoom: 0.55;
            }

            .grid {
                gap: 10px;
                margin-bottom: 10px;
            }

            .dash-card {
                padding: 12px;
                border: 1px solid #e5e7eb;
                box-shadow: none;
                break-inside: avoid;
                page-break-inside: avoid;
            }

            .dash-card-header {
                margin-bottom: 8px;
            }

            .dash-card-title { font-size: 15px; line-height: 1.25; }
            .dash-card-subtitle { font-size: 11px; line-height: 1.3; }
            .icon-box { width: 24px; height: 24px; font-size: 18px; }
            .kpi-value { font-size: 30px; line-height: 1.05; margin: 4px 0; }
            .kpi-footer, .trend-badge { font-size: 11px; }
            .chart-container { min-height: 160px; }

            .table-responsive,
            .campaign-table-wrap {
                overflow: visible !important;
            }

            .dash-table {
                min-width: 0 !important;
                width: 100% !important;
                table-layout: auto;
            }

            .dash-table th,
            .dash-table td {
                font-size: 9px;
                line-height: 1.2;
                padding: 5px 4px;
                white-space: normal;
            }

            .sortable-heading { cursor: default; }
            .sortable-heading::after { display: none; }
            * { cursor: default !important; }
            .dash-table tr:hover td,
            .sortable-heading:hover { background-color: transparent; }

            #tab-overview > .grid:first-child .dash-card { min-height: 0; }
            .ad-efficiency-body { min-height: 118px; gap: 18px; }
            .ad-efficiency-gauge { width: 170px; height: 102px; flex-basis: 170px; }
            .ad-efficiency-gauge-value > div { font-size: 28px; }
            .ad-efficiency-metric { font-size: 12px; }
            .insight-text { font-size: 14px; line-height: 1.35; margin: 8px 0; }
            .audience-kpi-item { padding: 12px; }
            .audience-device-chart { height: 190px; min-height: 190px; max-width: 240px; }
            .device-table-row > div { font-size: 12px; padding: 7px 6px; }
            .device-table-head > div { font-size: 11px; }
            .campaign-table-wrap .dash-table th,
            .campaign-table-wrap .dash-table td {
                font-size: 8px;
                padding: 4px 3px;
                line-height: 1.15;
            }
        }

        /* Final A4 report overrides: multi-page, no UI screenshot scaling */
        @page {
            size: A4 landscape;
            margin: 8mm;
        }

        body.pdf-report-mode,
        body.pdf-report-mode * {
            -webkit-print-color-adjust: exact !important;
            print-color-adjust: exact !important;
        }

        body.pdf-report-mode,
        body.pdf-report-mode .app-container,
        body.pdf-report-mode .dashboard-container {
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            padding: 0 !important;
            background: #fff !important;
            overflow: visible !important;
            opacity: 1 !important;
            transform: none !important;
        }

        body.pdf-report-mode .section-header,
        body.pdf-report-mode .top-header,
        body.pdf-report-mode .side-navbar,
        body.pdf-report-mode .nav-tabs-container,
        body.pdf-report-mode .section-controls,
        body.pdf-report-mode .date-picker-popover,
        body.pdf-report-mode .export-menu,
        body.pdf-report-mode .toast-container,
        body.pdf-report-mode .confirm-modal,
        body.pdf-report-mode .page-preloader,
        body.pdf-report-mode .control-btn,
        body.pdf-report-mode button,
        body.pdf-report-mode .insight-card {
            display: none !important;
        }

        body.pdf-report-mode .tab-pane,
        body.pdf-report-mode .tab-content-page {
            display: block !important;
            width: 100% !important;
            zoom: 1 !important;
            animation: none !important;
            page-break-after: always;
            break-after: page;
            page-break-inside: avoid;
            break-inside: avoid;
            margin: 0 !important;
            padding: 0 !important;
        }

        body.pdf-report-mode .tab-content-page:last-child {
            page-break-after: auto;
            break-after: auto;
        }

        body.pdf-report-mode .tab-content-page::before {
            content: "Маркетинг — раздел | Июнь 2026";
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 0 0 10px;
            padding: 0 0 8px;
            border-bottom: 1px solid #e5e7eb;
            color: var(--text-main);
            font-size: 18px;
            font-weight: 600;
            line-height: 1.2;
        }

        body.pdf-report-mode #tab-overview::before { content: "Маркетинг — Обзор | Июнь 2026"; }
        body.pdf-report-mode #tab-funnel::before { content: "Маркетинг — Воронка | Июнь 2026"; }
        body.pdf-report-mode #tab-audience::before { content: "Маркетинг — Аудитория | Июнь 2026"; }
        body.pdf-report-mode #tab-dynamics::before { content: "Маркетинг — Динамика | Июнь 2026"; }
        body.pdf-report-mode #tab-season::before { content: "Маркетинг — Сезонность | Июнь 2026"; }
        body.pdf-report-mode #tab-channels::before { content: "Маркетинг — Каналы | Июнь 2026"; }
        body.pdf-report-mode #tab-campaigns::before { content: "Маркетинг — Кампании | Июнь 2026"; }
        body.pdf-report-mode #tab-kpi::before { content: "Маркетинг — KPI | Июнь 2026"; }

        body.pdf-report-mode .grid {
            display: grid !important;
            grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
            gap: 10px !important;
            margin-bottom: 10px !important;
        }

        body.pdf-report-mode .span-3 { grid-column: span 3 !important; }
        body.pdf-report-mode .span-4 { grid-column: span 4 !important; }
        body.pdf-report-mode .span-5 { grid-column: span 5 !important; }
        body.pdf-report-mode .span-6 { grid-column: span 6 !important; }
        body.pdf-report-mode .span-7 { grid-column: span 7 !important; }
        body.pdf-report-mode .span-8 { grid-column: span 8 !important; }
        body.pdf-report-mode .span-12 { grid-column: span 12 !important; }

        body.pdf-report-mode .dash-card {
            padding: 10px !important;
            border: 1px solid #e5e7eb !important;
            box-shadow: none !important;
            break-inside: avoid;
            page-break-inside: avoid;
        }

        body.pdf-report-mode .dash-card-header {
            margin-bottom: 8px !important;
        }

        body.pdf-report-mode .dash-card-title { font-size: 16px !important; line-height: 1.25 !important; }
        body.pdf-report-mode .dash-card-subtitle { font-size: 12px !important; line-height: 1.3 !important; }
        body.pdf-report-mode .kpi-value { font-size: 36px !important; line-height: 1.05 !important; margin: 5px 0 !important; }
        body.pdf-report-mode .kpi-footer,
        body.pdf-report-mode .trend-badge { font-size: 12px !important; }
        body.pdf-report-mode .icon-box { width: 26px !important; height: 26px !important; font-size: 19px !important; }

        body.pdf-report-mode .chart-container {
            height: 165px !important;
            min-height: 165px !important;
            max-height: 185px !important;
        }

        body.pdf-report-mode #gaugeChart,
        body.pdf-report-mode canvas {
            max-width: 100% !important;
        }

        body.pdf-report-mode .ad-efficiency-body {
            min-height: 100px !important;
            gap: 20px !important;
        }

        body.pdf-report-mode .ad-efficiency-gauge {
            width: 150px !important;
            height: 90px !important;
            flex-basis: 150px !important;
        }

        body.pdf-report-mode .audience-kpi-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        }

        body.pdf-report-mode .audience-device-layout {
            grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) !important;
        }

        body.pdf-report-mode .audience-device-chart {
            height: 165px !important;
            min-height: 165px !important;
            max-width: 210px !important;
        }

        body.pdf-report-mode .table-responsive,
        body.pdf-report-mode .campaign-table-wrap {
            overflow: visible !important;
        }

        body.pdf-report-mode .dash-table {
            width: 100% !important;
            min-width: 0 !important;
            table-layout: auto !important;
        }

        body.pdf-report-mode .dash-table th,
        body.pdf-report-mode .dash-table td {
            font-size: 11px !important;
            line-height: 1.2 !important;
            padding: 5px 5px !important;
            white-space: normal !important;
        }

        body.pdf-report-mode .campaign-table-wrap .dash-table th,
        body.pdf-report-mode .campaign-table-wrap .dash-table td {
            font-size: 9px !important;
            padding: 4px 3px !important;
        }

        body.pdf-report-mode .kpi-table-wrap .dash-table {
            min-width: 0 !important;
            table-layout: fixed !important;
        }

        body.pdf-report-mode .kpi-table th,
        body.pdf-report-mode .kpi-table td {
            font-size: 8.5px !important;
            line-height: 1.15 !important;
            padding: 4px 3px !important;
        }

        body.pdf-report-mode .kpi-table th:first-child,
        body.pdf-report-mode .kpi-table td:first-child {
            width: 42px !important;
        }

        body.pdf-report-mode .kpi-table th:nth-child(8),
        body.pdf-report-mode .kpi-table td:nth-child(8) {
            display: none !important;
        }

        body.pdf-report-mode .kpi-toggle span {
            width: 28px !important;
            height: 16px !important;
        }

        body.pdf-report-mode .kpi-toggle span::after {
            top: 2px !important;
            left: 2px !important;
            width: 12px !important;
            height: 12px !important;
        }

        body.pdf-report-mode .kpi-toggle input:checked + span::after {
            transform: translateX(12px) !important;
        }

        body.pdf-report-mode .sortable-heading::after {
            display: none !important;
        }

        body.pdf-report-mode *,
        body.pdf-report-mode .sortable-heading {
            cursor: default !important;
        }

        body.pdf-report-mode .dash-table tr:hover td,
        body.pdf-report-mode .sortable-heading:hover {
            background-color: transparent !important;
        }

        body.pdf-report-mode .kpi-row-zoom-out-down {
            animation: none !important;
            opacity: 1 !important;
            transform: none !important;
        }

        @media print {
            * {
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }

            body,
            .app-container,
            .dashboard-container {
                width: 100% !important;
                max-width: none !important;
                margin: 0 !important;
                padding: 0 !important;
                background: #fff !important;
                overflow: visible !important;
                opacity: 1 !important;
                transform: none !important;
            }

            .section-header,
            .top-header,
            .side-navbar,
            .nav-tabs-container,
            .section-controls,
            .date-picker-popover,
            .export-menu,
            .toast-container,
            .confirm-modal,
            .page-preloader,
            .control-btn,
            button,
            .insight-card {
                display: none !important;
            }

            .tab-pane,
            .tab-content-page {
                display: block !important;
                width: 100% !important;
                zoom: 1 !important;
                animation: none !important;
                page-break-after: always;
                break-after: page;
                page-break-inside: avoid;
                break-inside: avoid;
                margin: 0 !important;
                padding: 0 !important;
            }

            .tab-content-page:last-child {
                page-break-after: auto;
                break-after: auto;
            }

            .tab-content-page::before {
                content: "Маркетинг — раздел | Июнь 2026";
                display: flex;
                margin: 0 0 10px;
                padding: 0 0 8px;
                border-bottom: 1px solid #e5e7eb;
                color: var(--text-main);
                font-size: 18px;
                font-weight: 600;
                line-height: 1.2;
            }

            #tab-overview::before { content: "Маркетинг — Обзор | Июнь 2026"; }
            #tab-funnel::before { content: "Маркетинг — Воронка | Июнь 2026"; }
            #tab-audience::before { content: "Маркетинг — Аудитория | Июнь 2026"; }
            #tab-dynamics::before { content: "Маркетинг — Динамика | Июнь 2026"; }
            #tab-season::before { content: "Маркетинг — Сезонность | Июнь 2026"; }
            #tab-channels::before { content: "Маркетинг — Каналы | Июнь 2026"; }
            #tab-campaigns::before { content: "Маркетинг — Кампании | Июнь 2026"; }
            #tab-kpi::before { content: "Маркетинг — KPI | Июнь 2026"; }

            .grid {
                display: grid !important;
                grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
                gap: 10px !important;
                margin-bottom: 10px !important;
            }

            .span-3 { grid-column: span 3 !important; }
            .span-4 { grid-column: span 4 !important; }
            .span-5 { grid-column: span 5 !important; }
            .span-6 { grid-column: span 6 !important; }
            .span-7 { grid-column: span 7 !important; }
            .span-8 { grid-column: span 8 !important; }
            .span-12 { grid-column: span 12 !important; }

            .dash-card {
                padding: 10px !important;
                border: 1px solid #e5e7eb !important;
                box-shadow: none !important;
                break-inside: avoid;
                page-break-inside: avoid;
            }

            .dash-card-header { margin-bottom: 8px !important; }
            .dash-card-title { font-size: 16px !important; line-height: 1.25 !important; }
            .dash-card-subtitle { font-size: 12px !important; line-height: 1.3 !important; }
            .kpi-value { font-size: 36px !important; line-height: 1.05 !important; margin: 5px 0 !important; }
            .kpi-footer, .trend-badge { font-size: 12px !important; }
            .icon-box { width: 26px !important; height: 26px !important; font-size: 19px !important; }

            .chart-container {
                height: 165px !important;
                min-height: 165px !important;
                max-height: 185px !important;
            }

            #gaugeChart,
            canvas { max-width: 100% !important; }

            .ad-efficiency-body { min-height: 100px !important; gap: 20px !important; }
            .ad-efficiency-gauge { width: 150px !important; height: 90px !important; flex-basis: 150px !important; }
            .audience-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
            .audience-device-layout { grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) !important; }
            .audience-device-chart { height: 165px !important; min-height: 165px !important; max-width: 210px !important; }

            .table-responsive,
            .campaign-table-wrap { overflow: visible !important; }

            .dash-table {
                width: 100% !important;
                min-width: 0 !important;
                table-layout: auto !important;
            }

            .dash-table th,
            .dash-table td {
                font-size: 11px !important;
                line-height: 1.2 !important;
                padding: 5px 5px !important;
                white-space: normal !important;
            }

            .campaign-table-wrap .dash-table th,
            .campaign-table-wrap .dash-table td {
                font-size: 9px !important;
                padding: 4px 3px !important;
            }

            .kpi-table-wrap .dash-table {
                min-width: 0 !important;
                table-layout: fixed !important;
            }

            .kpi-table th,
            .kpi-table td {
                font-size: 8.5px !important;
                line-height: 1.15 !important;
                padding: 4px 3px !important;
            }

            .kpi-table th:first-child,
            .kpi-table td:first-child {
                width: 42px !important;
            }

            .kpi-table th:nth-child(8),
            .kpi-table td:nth-child(8) {
                display: none !important;
            }

            .kpi-toggle span {
                width: 28px !important;
                height: 16px !important;
            }

            .kpi-toggle span::after {
                top: 2px !important;
                left: 2px !important;
                width: 12px !important;
                height: 12px !important;
            }

            .kpi-toggle input:checked + span::after {
                transform: translateX(12px) !important;
            }

            .sortable-heading::after { display: none !important; }
            *, .sortable-heading { cursor: default !important; }
            .dash-table tr:hover td,
            .sortable-heading:hover { background-color: transparent !important; }

            .kpi-row-zoom-out-down {
                animation: none !important;
                opacity: 1 !important;
                transform: none !important;
            }
        }

        /* Responsive */
        @media (max-width: 1400px) {
            .span-3 { grid-column: span 6; }
            .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
        }

        @media (max-width: 1200px) {
            .audience-kpi-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
            .audience-kpi-item:nth-child(2) {
                border-right: 0;
            }
            .audience-kpi-item:nth-child(-n + 2) {
                border-bottom: 1px solid var(--border-color);
            }
            .audience-device-layout {
                grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
            }
            .season-category-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }
        @media (max-width: 768px) {
            body {
                font-size: 18px;
            }

            .app-container {
                padding: 14px 12px 24px;
            }

            .nav-tabs-container {
                margin-bottom: 16px;
            }

            .nav-tab {
                font-size: 18px;
                padding: 7px 12px;
            }

            .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
            .section-header { flex-direction: column; align-items: flex-start; height: auto; gap: 14px; margin-bottom: 18px; }
            .budget-page-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 14px;
                margin-bottom: 18px;
            }
            .tasks-page-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 14px;
                margin-bottom: 18px;
            }
            .links-page-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 14px;
                margin-bottom: 18px;
            }
            .settings-page-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 14px;
                margin-bottom: 18px;
            }
            .budget-page-header .section-title h1 {
                font-size: 32px;
                line-height: 1.18;
            }
            .tasks-page-header .section-title h1 {
                font-size: 32px;
                line-height: 1.18;
            }
            .links-page-header .section-title h1 {
                font-size: 32px;
                line-height: 1.18;
            }
            .settings-page-header .section-title h1 {
                font-size: 32px;
                line-height: 1.18;
            }
            .tasks-page-header .section-title p {
                font-size: 18px;
            }
            .links-page-header .section-title p {
                font-size: 18px;
            }
            .links-header-actions {
                width: 100%;
            }
            .links-header-actions .control-btn {
                flex: 1 1 0;
                justify-content: center;
            }
            .links-board {
                grid-template-columns: 1fr;
                gap: 14px;
            }
            .links-category {
                border-radius: 12px;
                padding: 14px;
            }
            .link-card {
                grid-template-columns: 38px minmax(0, 1fr);
                gap: 10px;
            }
            .link-card-actions {
                grid-column: 2;
            }
            .link-logo {
                width: 38px;
                height: 38px;
            }
            .settings-page-header .section-title p {
                font-size: 18px;
            }
            .settings-tabs-container {
                margin-bottom: 16px;
            }
            .settings-tab {
                font-size: 18px;
                padding: 7px 12px;
            }
            .settings-layout,
            .settings-integrations-grid,
            .settings-form-grid,
            .settings-form-grid.compact {
                grid-template-columns: 1fr;
            }
            .settings-profile-forms {
                grid-column: 1;
            }
            .settings-actions {
                justify-content: stretch;
            }
            .settings-actions .control-btn {
                width: 100%;
                justify-content: center;
            }
            .budget-add-btn {
                width: 100%;
                justify-content: center;
            }
            .tasks-toolbar {
                width: 100%;
                justify-content: stretch;
            }
            .tasks-search {
                min-width: 0;
                width: 100%;
            }
            .tasks-view-toggle {
                width: 100%;
            }
            .tasks-view-toggle button {
                flex: 1 1 0;
                justify-content: center;
            }
            .section-title h1 {
                font-size: 32px;
                line-height: 1.18;
                white-space: nowrap;
            }
            .section-title p {
                font-size: 18px;
                line-height: 1.45;
            }
            .section-controls {
                width: 100%;
                gap: 10px;
                overflow-x: auto;
                padding-bottom: 2px;
            }
            .section-controls::-webkit-scrollbar {
                display: none;
            }
            .control-btn {
                height: 34px;
                padding: 0 12px;
                font-size: 17px;
                border-radius: 10px;
            }
            .control-btn.icon-only {
                width: 34px;
            }
            .date-picker-popover {
                position: fixed;
                top: 96px;
                left: 12px;
                right: 12px;
                width: auto;
            }
            .date-picker-grid button,
            .date-picker-grid span {
                width: 100%;
            }
            .search-container { display: none; }
            .dash-card {
                border-radius: 12px;
                padding: 18px;
            }
            .dash-card-header {
                gap: 12px;
                margin-bottom: 14px;
            }
            .dash-card-title {
                font-size: 20px;
                line-height: 1.35;
            }
            .dash-card-subtitle {
                font-size: 17px;
                line-height: 1.45;
            }
            .audience-kpi-grid {
                grid-template-columns: 1fr;
            }
            .audience-kpi-item {
                padding: 18px;
                border-right: 0;
                border-bottom: 1px solid var(--border-color);
            }
            .audience-kpi-item:last-child {
                border-bottom: 0;
            }
            .audience-kpi-item:nth-child(-n + 2) {
                border-bottom: 1px solid var(--border-color);
            }
            .audience-device-layout {
                grid-template-columns: 1fr;
                gap: 18px;
            }
            .audience-device-chart {
                height: 220px;
                min-height: 220px;
                max-width: 240px;
            }
            .device-table-row {
                grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr) minmax(0, 0.9fr);
            }
            .device-table-row > div {
                padding-left: 4px;
                padding-right: 4px;
            }
            .season-category-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }
            .season-category-card {
                min-height: 0;
            }
            .season-category-title {
                font-size: 18px;
            }
            .season-category-growth {
                font-size: 20px;
            }
            .season-category-card p {
                font-size: 16px;
                margin-top: 14px;
            }
            .season-demand-chart {
                width: 720px;
                min-width: 720px;
                height: 320px;
            }
            .season-chart-scroll {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                margin: 0 -4px;
                padding: 0 4px 8px;
            }
            .kpi-value {
                font-size: 30px;
                white-space: nowrap;
            }
            .kpi-footer {
                gap: 12px;
                align-items: flex-end;
            }
            .kpi-footer > span:first-child {
                min-width: 0;
                line-height: 1.35;
            }
            .trend-badge {
                flex-shrink: 0;
                white-space: nowrap;
            }
            .ad-efficiency-body {
                display: flex;
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
                margin-top: 12px;
                padding-bottom: 0;
                flex: none;
                min-height: 0;
            }
            .ad-efficiency-gauge {
                width: 220px;
                height: 128px;
                flex-basis: auto;
                margin: 0 auto;
            }
            .ad-efficiency-gauge-value > div {
                font-size: 32px;
            }
            .ad-efficiency-summary {
                width: 100%;
                align-self: stretch;
                align-items: center;
                text-align: center;
            }
            .ad-efficiency-summary .text-success {
                line-height: 1.45;
            }
            .ad-efficiency-metrics {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 10px;
                padding-top: 4px;
            }
            .ad-efficiency-metric {
                font-size: 18px;
                text-align: center;
            }
            .table-responsive {
                margin: 0 -2px;
                padding-bottom: 8px;
            }
            .dash-table {
                min-width: 860px;
            }
            .dash-table th {
                font-size: 15px;
                line-height: 1.35;
                padding: 12px 10px;
            }
            .dash-table td {
                font-size: 15px;
                line-height: 1.35;
                padding: 12px 10px;
            }
            .kpi-table-wrap {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                margin: 0 -2px;
                padding-bottom: 10px;
            }
            .kpi-table-wrap .kpi-table {
                min-width: 1220px;
                table-layout: auto;
            }
            .kpi-table th,
            .kpi-table td {
                white-space: nowrap;
                overflow-wrap: normal;
                word-break: normal;
                font-size: 15px;
                line-height: 1.35;
                padding: 12px 10px;
            }
            .kpi-table th:first-child,
            .kpi-table td:first-child {
                width: 82px;
            }
            .kpi-table th:nth-child(2),
            .kpi-table td:nth-child(2) {
                width: 260px;
            }
            .kpi-table th:nth-child(3),
            .kpi-table td:nth-child(3) {
                width: 250px;
            }
            .kpi-table th:nth-child(8),
            .kpi-table td:nth-child(8) {
                width: 82px;
            }
            .budget-table-wrap .dash-table {
                min-width: 1120px;
            }
            .task-form {
                width: 100%;
            }
            .quick-task-line {
                min-height: 44px;
                grid-template-columns: 22px minmax(0, 1fr) 30px;
                padding: 0 9px;
            }
            .quick-task-details {
                padding: 10px 12px 10px 40px;
            }
            .quick-task-meta {
                gap: 2px;
            }
            .quick-action-btn {
                padding: 0 7px;
                font-size: 13px;
            }
            .quick-popover {
                position: fixed;
                left: 16px;
                right: 16px;
                top: auto;
                bottom: 18px;
                min-width: 0;
            }
            .tasks-list {
                border-radius: 12px;
            }
            .task-row-details {
                margin: 0 9px 9px 40px;
            }
            .task-detail-grid {
                grid-template-columns: 1fr;
                gap: 8px;
            }
            .task-title {
                font-size: 15px;
            }
            .kanban-board {
                min-height: clamp(420px, calc(100vh - 360px), 620px);
            }
            .kanban-column {
                flex: 0 0 254px;
                width: 254px;
            }
            .chart-container {
                min-height: 240px;
            }
            .audience-insight-item {
                grid-template-columns: 32px 1fr;
                gap: 12px;
                font-size: 16px;
            }
            .audience-insight-item .material-symbols-rounded {
                width: 32px;
                height: 32px;
                font-size: 19px;
            }
        }
        
        /* Confirm modal */
        .confirm-modal {
            position: fixed;
            inset: 0;
            z-index: 9500;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.18s ease, visibility 0.18s ease;
        }

        .confirm-modal.is-open {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }

        .confirm-modal-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(17, 24, 39, 0.34);
            backdrop-filter: blur(5px);
        }

        .confirm-dialog {
            position: relative;
            width: min(420px, 100%);
            display: grid;
            grid-template-columns: 42px 1fr;
            gap: 14px;
            padding: 18px;
            border: 1px solid var(--border-color);
            border-radius: 16px;
            background: var(--card-bg);
            box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
            transform: translateY(10px) scale(0.98);
            transition: transform 0.18s ease;
        }

        .confirm-modal.is-open .confirm-dialog {
            transform: translateY(0) scale(1);
        }

        .confirm-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 42px;
            height: 42px;
            border-radius: 12px;
            background: rgba(229, 72, 77, 0.1);
            color: var(--negative);
        }

        .confirm-icon .material-symbols-rounded {
            font-size: 23px;
        }

        .confirm-content {
            min-width: 0;
        }

        .confirm-title {
            color: var(--text-main);
            font-size: 18px;
            font-weight: 700;
            line-height: 1.25;
        }

        .confirm-message {
            margin-top: 6px;
            color: var(--text-secondary);
            font-size: 15px;
            line-height: 1.45;
        }

        .confirm-actions {
            grid-column: 1 / -1;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 4px;
        }

        .confirm-btn {
            height: 38px;
            padding: 0 16px;
            border-radius: 10px;
            border: 1px solid transparent;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
        }

        .confirm-btn.secondary {
            border-color: var(--border-color);
            background: var(--card-bg);
            color: var(--text-secondary);
        }

        .confirm-btn.secondary:hover {
            color: var(--text-main);
            background: var(--bg-secondary);
        }

        .confirm-btn.danger {
            background: var(--negative);
            color: #fff;
        }

        .confirm-btn.danger:hover {
            background: #D3383D;
        }

        /* Toast */
        .toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
        .toast-custom {
            background: var(--card-bg);
            border-radius: 12px;
            box-shadow: 0 4px 14px rgba(0,0,0,0.1);
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            border-left: 4px solid var(--accent-primary);
            margin-top: 10px;
            opacity: 0;
            transform: translateX(100%);
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
        .toast-custom.show { opacity: 1; transform: translateX(0); }

        /* Global interactive polish */
        .quick-task-submit,
        .task-detail-btn,
        .task-delete-btn,
        .budget-delete-row-btn,
        .kpi-row-delete-btn,
        .settings-user-action,
        .link-icon-btn,
        .kanban-column-actions button {
            width: 32px;
            height: 32px;
            border-radius: 9px;
            box-shadow: none;
        }

        .quick-task-submit:hover,
        .quick-action-btn:hover,
        .task-detail-btn:hover,
        .task-delete-btn:hover,
        .budget-delete-row-btn:hover,
        .kpi-row-delete-btn:hover,
        .settings-user-action:hover,
        .settings-user-action:focus-visible,
        .link-icon-btn:hover,
        .link-icon-btn:focus-visible,
        .kanban-column-actions button:hover,
        .auth-password button:hover,
        .btn-icon:hover {
            background: var(--bg-secondary);
            border-color: var(--border-color);
            color: var(--text-main);
            box-shadow: none;
        }

        /* Global form/table polish */
        input:focus,
        select:focus,
        textarea:focus,
        [contenteditable="true"]:focus,
        .auth-field:focus-within > input,
        .auth-field:focus-within .auth-password,
        .settings-field input:focus,
        .settings-field select:focus,
        .settings-field textarea:focus,
        .search-container input:focus,
        .task-field input:focus,
        .task-field textarea:focus,
        .task-field select:focus,
        .quick-popover input:focus,
        .quick-popover textarea:focus,
        .kpi-table td[contenteditable="true"]:focus,
        .budget-table td[contenteditable="true"]:focus {
            border-color: var(--border-color) !important;
            box-shadow: none !important;
            outline: none !important;
        }

        .table-responsive,
        .access-table-wrap,
        .kpi-table-wrap,
        .budget-table-wrap,
        .campaign-table-wrap {
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        .table-responsive::-webkit-scrollbar,
        .access-table-wrap::-webkit-scrollbar,
        .kpi-table-wrap::-webkit-scrollbar,
        .budget-table-wrap::-webkit-scrollbar,
        .campaign-table-wrap::-webkit-scrollbar {
            display: none;
        }
