        /* ── TOKENS ───────────────────────────────── */
        :root {
            --bg: #0f1117;
            --bg2: #161b27;
            --bg3: #1e2535;
            --surface: #242d3e;
            --border: #2e3a52;
            --accent: #4f80ff;
            --accent2: #7c5cfc;
            --green: #2dd4a0;
            --yellow: #f5c842;
            --red: #f0545a;
            --orange: #ff8c42;
            --text: #e4eaf5;
            --text2: #8fa3c4;
            --text3: #5a6f8a;
            --radius: 10px;
            --radius-sm: 6px;
            --shadow: 0 4px 24px rgba(0, 0, 0, .45);
        }

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

        html {
            height: 100%;
        }

        body {
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            font-family: 'Inter', system-ui, sans-serif;
            background: var(--bg);
            color: var(--text);
            font-size: 14px;
        }

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

        /* ── LAYOUT ───────────────────────────────── */
        #app {
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* ── LAUNCHER ─────────────────────────────── */
        #launcher {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            gap: 32px;
            background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(79, 128, 255, .12) 0%, transparent 70%),
                radial-gradient(ellipse 60% 40% at 80% 20%, rgba(124, 92, 252, .08) 0%, transparent 60%),
                var(--bg);
        }

        .launcher-logo {
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 4px;
            color: var(--accent);
            text-transform: uppercase;
            opacity: .8;
        }

        .launcher-title {
            font-size: 52px;
            font-weight: 700;
            letter-spacing: -2px;
            background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            text-align: center;
            line-height: 1.1;
        }

        .launcher-sub {
            color: var(--text2);
            font-size: 16px;
            text-align: center;
            max-width: 500px;
        }

        .launcher-actions {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .btn-launch {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 14px 28px;
            border-radius: var(--radius);
            border: none;
            cursor: pointer;
            font-size: 15px;
            font-weight: 600;
            transition: all .18s ease;
        }

        .btn-launch.primary {
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
            color: #fff;
            box-shadow: 0 4px 20px rgba(79, 128, 255, .35);
        }

        .btn-launch.primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 28px rgba(79, 128, 255, .45);
        }

        .btn-launch.secondary {
            background: var(--surface);
            color: var(--text);
            border: 1px solid var(--border);
        }

        .btn-launch.secondary:hover {
            background: var(--bg3);
            border-color: var(--accent);
        }

        .btn-launch svg {
            width: 18px;
            height: 18px;
        }

        .recent-box {
            width: 100%;
            max-width: 500px;
        }

        .recent-title {
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 2px;
            color: var(--text3);
            text-transform: uppercase;
            margin-bottom: 10px;
        }

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

        .recent-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all .15s;
        }

        .recent-item:hover {
            border-color: var(--accent);
            background: var(--bg3);
        }

        .recent-item .ri-icon {
            font-size: 18px;
        }

        .recent-item .ri-name {
            font-weight: 500;
            flex: 1;
        }

        .recent-item .ri-date {
            font-size: 11px;
            color: var(--text3);
        }

        /* ── TOP BAR ──────────────────────────────── */
        #topbar {
            display: none;
            align-items: center;
            gap: 0;
            height: 48px;
            background: var(--bg2);
            border-bottom: 1px solid var(--border);
            padding: 0;
            flex-shrink: 0;
        }

        .tb-logo {
            padding: 0 20px;
            font-weight: 700;
            font-size: 15px;
            color: var(--accent);
            letter-spacing: -.3px;
            border-right: 1px solid var(--border);
            height: 100%;
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }

        .tb-project-name {
            padding: 0 16px;
            font-weight: 500;
            color: var(--text2);
            font-size: 13px;
            border-right: 1px solid var(--border);
            height: 100%;
            display: flex;
            align-items: center;
            cursor: pointer;
            transition: .15s;
        }

        .tb-project-name:hover {
            color: var(--text);
        }

        .tb-spacer {
            flex: 1;
        }

        .tb-actions {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 0 12px;
        }

        .tb-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            border: 1px solid transparent;
            background: none;
            color: var(--text2);
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: .15s;
        }

        .tb-btn:hover {
            background: var(--surface);
            color: var(--text);
            border-color: var(--border);
        }

        .tb-btn.accent {
            background: var(--accent);
            color: #fff;
            border-color: var(--accent);
        }

        .tb-btn.accent:hover {
            background: var(--accent2);
            border-color: var(--accent2);
        }

        .tb-btn svg {
            width: 15px;
            height: 15px;
        }

        .tb-divider {
            width: 1px;
            height: 24px;
            background: var(--border);
            margin: 0 4px;
        }

        /* ── SIDEBAR ──────────────────────────────── */
        #sidebar {
            display: none;
            flex-direction: column;
            width: 56px;
            flex-shrink: 0;
            background: var(--bg2);
            border-right: 1px solid var(--border);
            overflow: hidden;
            transition: width .2s ease;
        }

        #sidebar.expanded {
            width: 200px;
        }

        .sb-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            color: var(--text2);
            transition: .15s;
            white-space: nowrap;
            border-left: 2px solid transparent;
        }

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

        .sb-item.active {
            color: var(--accent);
            border-left-color: var(--accent);
            background: rgba(79, 128, 255, .07);
        }

        .sb-item svg {
            width: 18px;
            height: 18px;
            flex-shrink: 0;
        }

        .sb-label {
            opacity: 0;
            transition: .15s;
        }

        #sidebar.expanded .sb-label {
            opacity: 1;
        }

        /* ── MAIN BODY ────────────────────────────── */
        #body {
            display: none;
            flex: 1;
            overflow: hidden;
            flex-direction: row;
        }

        #content {
            flex: 1;
            overflow: auto;
            padding: 24px;
        }

        /* ── CARDS / PANELS ───────────────────────── */
        .panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
        }

        .panel-title {
            font-size: 20px;
            font-weight: 700;
            letter-spacing: -.4px;
        }

        .panel-sub {
            font-size: 13px;
            color: var(--text2);
            margin-top: 2px;
        }

        /* ── SCHEDULE TABLE ───────────────────────── */
        .sched-table {
            width: 100%;
            border-collapse: collapse;
        }

        .sched-table th {
            text-align: left;
            padding: 8px 12px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 1px;
            color: var(--text3);
            text-transform: uppercase;
            background: var(--bg2);
            border-bottom: 2px solid var(--border);
            white-space: nowrap;
            /* Sticky header so it stays visible during vertical scroll */
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .sched-table td {
            padding: 8px 12px;
            border-bottom: 1px solid var(--border);
            font-size: 13px;
            transition: background .1s;
        }

        .sched-table tr:hover td {
            background: var(--surface);
        }

        .sched-table tr.level-0 td {
            background: rgba(79, 128, 255, .06);
            font-weight: 700;
            font-size: 14px;
        }

        .sched-table tr.level-1 td {
            background: rgba(79, 128, 255, .03);
            font-weight: 600;
        }

        .sched-table .wbs-cell {
            color: var(--text3);
            font-family: monospace;
            font-size: 12px;
            white-space: nowrap;
        }

        .sched-table .name-cell {
            max-width: 380px;
        }

        .indent {
            display: inline-block;
        }

        /* ── STATUS BADGES ────────────────────────── */
        .badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            border-radius: 99px;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
        }

        .badge.not-started {
            background: rgba(142, 160, 185, .13);
            color: var(--text2);
        }

        .badge.in-progress {
            background: rgba(79, 128, 255, .18);
            color: var(--accent);
        }

        .badge.complete {
            background: rgba(45, 212, 160, .15);
            color: var(--green);
        }

        .badge.on-hold {
            background: rgba(245, 200, 66, .15);
            color: var(--yellow);
        }

        .badge.summary {
            background: rgba(124, 92, 252, .15);
            color: var(--accent2);
        }

        .badge.immediate {
            background: rgba(240, 84, 90, .2);
            color: var(--red);
        }

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

        .cp-badge {
            color: var(--red);
            font-size: 11px;
            font-weight: 700;
        }

        .milestone-diamond {
            color: var(--yellow);
            font-size: 14px;
        }

        /* ── PROGRESS BAR ─────────────────────────── */
        .pct-bar {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .pct-track {
            flex: 1;
            min-width: 60px;
            height: 4px;
            background: var(--border);
            border-radius: 2px;
        }

        .pct-fill {
            height: 100%;
            border-radius: 2px;
            background: linear-gradient(90deg, var(--accent), var(--green));
            transition: width .3s;
        }

        .pct-label {
            font-size: 11px;
            color: var(--text2);
            width: 32px;
            text-align: right;
        }

        /* ── FILTER BAR ───────────────────────────── */
        .filter-bar {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        .filter-input {
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 7px 12px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            outline: none;
            transition: .15s;
        }

        .filter-input:focus {
            border-color: var(--accent);
        }

        .filter-select {
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 7px 12px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            outline: none;
            cursor: pointer;
        }

        /* ── RISK TABLE ───────────────────────────── */
        .risk-score {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 6px;
            font-weight: 700;
            font-size: 13px;
        }

        .risk-score.high {
            background: rgba(240, 84, 90, .2);
            color: var(--red);
        }

        .risk-score.medium {
            background: rgba(245, 200, 66, .2);
            color: var(--yellow);
        }

        .risk-score.low {
            background: rgba(45, 212, 160, .15);
            color: var(--green);
        }

        /* ── MILESTONE TIMELINE ───────────────────── */
        .timeline {
            position: relative;
            padding: 8px 0;
        }

        .tl-item {
            display: flex;
            gap: 16px;
            padding: 12px 0;
            position: relative;
        }

        .tl-item::before {
            content: '';
            position: absolute;
            left: 17px;
            top: 0;
            bottom: 0;
            width: 1px;
            background: var(--border);
        }

        .tl-item:first-child::before {
            top: 50%;
        }

        .tl-item:last-child::before {
            bottom: 50%;
        }

        .tl-dot {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid var(--border);
            background: var(--bg2);
            font-size: 14px;
            position: relative;
            z-index: 1;
        }

        .tl-dot.done {
            border-color: var(--green);
            background: rgba(45, 212, 160, .1);
        }

        .tl-dot.active {
            border-color: var(--accent);
            background: rgba(79, 128, 255, .1);
        }

        .tl-dot.risk {
            border-color: var(--red);
            background: rgba(240, 84, 90, .1);
        }

        .tl-body {
            flex: 1;
            padding-top: 4px;
        }

        .tl-name {
            font-weight: 600;
            font-size: 14px;
        }

        .tl-meta {
            font-size: 12px;
            color: var(--text2);
            margin-top: 3px;
            display: flex;
            gap: 16px;
        }

        /* ── FUNDING BARS ─────────────────────────── */
        .funding-grid {
            display: grid;
            gap: 12px;
        }

        .funding-row {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 16px;
        }

        .funding-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .funding-source {
            font-weight: 600;
        }

        .funding-amount {
            font-weight: 700;
            font-size: 16px;
            color: var(--accent);
        }

        .funding-bar {
            height: 8px;
            background: var(--border);
            border-radius: 4px;
            overflow: hidden;
        }

        .funding-fill {
            height: 100%;
            border-radius: 4px;
            background: linear-gradient(90deg, var(--accent), var(--accent2));
        }

        .funding-meta {
            display: flex;
            justify-content: space-between;
            margin-top: 8px;
            font-size: 12px;
            color: var(--text2);
        }

        /* ── INLINE EDITING ───────────────────────── */
        .editable {
            cursor: text;
            border-radius: 3px;
            padding: 1px 3px;
            transition: background .15s;
        }

        .editable:hover {
            background: rgba(79, 128, 255, .12);
        }

        .editable:focus {
            outline: none;
            background: rgba(79, 128, 255, .18);
            box-shadow: 0 0 0 2px var(--accent);
            border-radius: 3px;
        }

        /* ── TOAST ────────────────────────────────── */
        #toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 9999;
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 12px 20px;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            font-size: 13px;
            font-weight: 500;
            transform: translateY(80px);
            opacity: 0;
            transition: all .3s ease;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        #toast.show {
            transform: translateY(0);
            opacity: 1;
        }

        #toast .toast-icon {
            font-size: 16px;
        }

        /* ── MODAL ────────────────────────────────── */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, .6);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
            opacity: 0;
            pointer-events: none;
            transition: .2s;
        }

        .modal-overlay.open {
            opacity: 1;
            pointer-events: all;
        }

        .modal {
            background: var(--bg2);
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 28px;
            width: 480px;
            max-width: calc(100vw - 32px);
            box-shadow: 0 8px 48px rgba(0, 0, 0, .6);
            transform: scale(.96);
            transition: .2s;
        }

        .modal-overlay.open .modal {
            transform: scale(1);
        }

        .modal h2 {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .modal p {
            color: var(--text2);
            font-size: 13px;
            margin-bottom: 20px;
        }

        .form-field {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 16px;
        }

        .form-field label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text2);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .form-field input,
        .form-field textarea {
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 10px 12px;
            border-radius: var(--radius-sm);
            font-size: 14px;
            outline: none;
            font-family: inherit;
            transition: .15s;
        }

        .form-field input:focus,
        .form-field textarea:focus {
            border-color: var(--accent);
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 24px;
        }

        /* ── SCROLLBAR ────────────────────────────── */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text3);
        }

        /* ── UTILITIES ────────────────────────────── */
        .flex {
            display: flex;
        }

        .gap8 {
            gap: 8px;
        }

        .gap12 {
            gap: 12px;
        }

        .items-center {
            align-items: center;
        }

        .justify-between {
            justify-content: space-between;
        }

        .text-sm {
            font-size: 12px;
        }

        .text-muted {
            color: var(--text2);
        }

        .bold {
            font-weight: 700;
        }

        .hidden {
            display: none !important;
        }

        /* ── SECTION TABS ─────────────────────────── */
        .sec-tabs {
            display: flex;
            gap: 4px;
            border-bottom: 1px solid var(--border);
            margin-bottom: 20px;
        }

        .sec-tab {
            padding: 8px 16px;
            font-size: 13px;
            font-weight: 500;
            color: var(--text2);
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: .15s;
            border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        }

        .sec-tab:hover {
            color: var(--text);
            background: var(--surface);
        }

        .sec-tab.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }

        /* ── STATS STRIP ──────────────────────────── */
        .stats-strip {
            display: flex;
            gap: 16px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .stat-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px 20px;
            flex: 1;
            min-width: 120px;
        }

        .stat-card .sc-val {
            font-size: 28px;
            font-weight: 700;
            line-height: 1;
        }

        .stat-card .sc-lbl {
            font-size: 11px;
            color: var(--text2);
            margin-top: 4px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: .8px;
        }

        .sc-val.blue {
            color: var(--accent);
        }

        .sc-val.green {
            color: var(--green);
        }

        .sc-val.yellow {
            color: var(--yellow);
        }

        .sc-val.red {
            color: var(--red);
        }

        /* ── EMPTY STATE ──────────────────────────── */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px;
            gap: 12px;
            color: var(--text2);
            text-align: center;
        }

        .empty-state .es-icon {
            font-size: 48px;
            opacity: .3;
        }

        .empty-state .es-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text3);
        }

        /* ── DASHBOARD ───────────────────────────── */
        .dash-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-rows: auto auto;
            gap: 20px;
        }

        .dash-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .dash-card.full {
            grid-column: 1 / -1;
        }

        .dash-card-title {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: var(--text3);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .dash-card-title span {
            font-size: 14px;
        }

        /* action items */
        .action-item {
            display: flex;
            gap: 12px;
            align-items: flex-start;
            padding: 10px 0;
            border-bottom: 1px solid var(--border);
        }

        .action-item:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .action-item:first-child {
            padding-top: 0;
        }

        .ai-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            flex-shrink: 0;
        }

        .ai-icon.red {
            background: rgba(240, 84, 90, .15);
        }

        .ai-icon.yellow {
            background: rgba(245, 200, 66, .15);
        }

        .ai-icon.blue {
            background: rgba(79, 128, 255, .15);
        }

        .ai-icon.green {
            background: rgba(45, 212, 160, .15);
        }

        .ai-body {
            flex: 1;
        }

        .ai-title {
            font-weight: 600;
            font-size: 13px;
            line-height: 1.3;
        }

        .ai-meta {
            font-size: 11px;
            color: var(--text2);
            margin-top: 3px;
        }

        .ai-due {
            font-size: 11px;
            font-weight: 600;
            padding: 2px 7px;
            border-radius: 4px;
            white-space: nowrap;
        }

        .ai-due.overdue {
            background: rgba(240, 84, 90, .18);
            color: var(--red);
        }

        .ai-due.soon {
            background: rgba(245, 200, 66, .15);
            color: var(--yellow);
        }

        .ai-due.ok {
            background: rgba(79, 128, 255, .12);
            color: var(--accent);
        }

        /* upcoming events */
        .event-item {
            display: flex;
            gap: 14px;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid var(--border);
        }

        .event-item:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .event-item:first-child {
            padding-top: 0;
        }

        .event-date-box {
            text-align: center;
            min-width: 44px;
            background: var(--bg3);
            border-radius: 8px;
            padding: 5px 8px;
            flex-shrink: 0;
        }

        .event-date-box .edb-mo {
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: var(--text3);
        }

        .event-date-box .edb-day {
            font-size: 20px;
            font-weight: 700;
            line-height: 1;
            color: var(--text);
        }

        .event-body {
            flex: 1;
        }

        .event-name {
            font-weight: 500;
            font-size: 13px;
        }

        .event-ws {
            font-size: 11px;
            color: var(--text2);
            margin-top: 2px;
        }

        .event-badge {
            flex-shrink: 0;
        }

        /* doc tracker */
        .doc-section {
            margin-bottom: 16px;
        }

        .doc-section:last-child {
            margin-bottom: 0;
        }

        .doc-section-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
        }

        .doc-section-name {
            font-weight: 600;
            font-size: 13px;
        }

        .doc-fraction {
            font-size: 13px;
            font-weight: 700;
            color: var(--text2);
        }

        .doc-fraction .num {
            color: var(--accent);
        }

        .doc-pips {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
            margin-bottom: 4px;
        }

        .doc-pip {
            height: 8px;
            flex: 1;
            min-width: 20px;
            max-width: 40px;
            border-radius: 4px;
            background: var(--border);
            transition: background .2s;
        }

        .doc-pip.done {
            background: var(--green);
        }

        .doc-pip.active {
            background: var(--accent);
        }

        .doc-pip.urgent {
            background: var(--red);
        }

        .doc-items {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-top: 6px;
        }

        .doc-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text2);
        }

        .doc-item .di-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .doc-item .di-dot.done {
            background: var(--green);
        }

        .doc-item .di-dot.active {
            background: var(--accent);
        }

        .doc-item .di-dot.urgent {
            background: var(--red);
        }

        .doc-item .di-dot.ns {
            background: var(--border);
        }

        .doc-item .di-name {
            flex: 1;
        }

        .doc-item .di-due {
            font-size: 11px;
            font-weight: 600;
            color: var(--text3);
            white-space: nowrap;
        }

        /* ── VALIDATION ────────────────────────────── */
        .val-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 99px;
            cursor: pointer;
            margin-right: 8px;
            transition: opacity .15s;
        }
        .val-badge:hover { opacity: .8; }
        .val-badge.error   { background: rgba(240,84,90,.2);  color: var(--red);    border: 1px solid rgba(240,84,90,.4); }
        .val-badge.warning { background: rgba(245,200,66,.15); color: var(--yellow); border: 1px solid rgba(245,200,66,.3); }

        .val-summary {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }
        .val-pill {
            display: inline-flex;
            align-items: center;
            font-size: 11px;
            font-weight: 700;
            padding: 4px 12px;
            border-radius: 99px;
        }
        .val-pill.critical { background: rgba(240,84,90,.2);  color: var(--red);    }
        .val-pill.error    { background: rgba(240,84,90,.15); color: var(--red);    }
        .val-pill.warning  { background: rgba(245,200,66,.15);color: var(--yellow); }
        .val-pill.info     { background: rgba(79,128,255,.15); color: var(--accent); }
        .val-pill.ok       { background: rgba(45,212,160,.15); color: var(--green);  }

        .val-actions {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }

        .val-row td { vertical-align: top; padding: 8px 10px; }
        .val-row-critical { border-left: 3px solid var(--red); }
        .val-row-error    { border-left: 3px solid #f0545a88; }
        .val-row-warning  { border-left: 3px solid #f5c84260; }
        .val-row-info     { border-left: 3px solid #4f80ff40; }

        .val-sev-badge {
            display: inline-block;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 4px;
            white-space: nowrap;
            text-transform: uppercase;
        }
        .val-sev-badge.critical { background: rgba(240,84,90,.25); color: var(--red); }
        .val-sev-badge.error    { background: rgba(240,84,90,.15); color: var(--red); }
        .val-sev-badge.warning  { background: rgba(245,200,66,.15);color: var(--yellow); }
        .val-sev-badge.info     { background: rgba(79,128,255,.15); color: var(--accent); }

        .val-code {
            font-family: monospace;
            font-size: 11px;
            color: var(--text2);
            background: var(--surface);
            padding: 2px 5px;
            border-radius: 3px;
        }

        .val-repair-btn {
            background: rgba(79,128,255,.15);
            border: 1px solid rgba(79,128,255,.3);
            color: var(--accent);
            font-size: 11px;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 5px;
            cursor: pointer;
            white-space: nowrap;
        }
        .val-repair-btn:hover { background: rgba(79,128,255,.3); }

        .val-readonly-banner {
            background: rgba(245,200,66,.1);
            border: 1px solid rgba(245,200,66,.3);
            color: var(--yellow);
            padding: 12px 16px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        /* data-table used by validation view */
        .data-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
        }
        .data-table thead th {
            text-align: left;
            padding: 8px 10px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: .08em;
            text-transform: uppercase;
            color: var(--text3);
            border-bottom: 1px solid var(--border);
        }
        .data-table tbody tr:hover { background: var(--surface); }
        .data-table tbody td { border-bottom: 1px solid rgba(46,58,82,.3); }

        /* ── Calculation Preview Modal ──────────────────── */
        .calc-preview-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }
        .calc-stat {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 12px;
            text-align: center;
        }
        .calc-stat-val {
            font-size: 22px;
            font-weight: 800;
            color: var(--text);
            line-height: 1.1;
        }
        .calc-stat-label {
            font-size: 10px;
            font-weight: 600;
            color: var(--text3);
            text-transform: uppercase;
            letter-spacing: .06em;
            margin-top: 4px;
        }
        .calc-section {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding: 8px 0;
            border-bottom: 1px solid var(--border);
            margin-bottom: 4px;
        }
        .calc-label {
            font-size: 12px;
            color: var(--text2);
        }
        .calc-value {
            font-size: 14px;
            font-weight: 700;
            color: var(--text);
        }
        .calc-warn-row {
            display: flex;
            align-items: baseline;
            gap: 8px;
            font-size: 12px;
            color: var(--text2);
            padding: 5px 0;
            border-bottom: 1px solid rgba(46,58,82,.3);
        }

        /* ── Activity number column ─────────────────────────────────────────── */
        .act-num-th,
        .act-num-cell {
            width: 38px;
            min-width: 38px;
            text-align: right;
            padding-right: 10px !important;
            color: var(--text3);
            font-size: 11px;
            font-family: monospace;
            font-weight: 600;
            user-select: none;
        }
        .act-num-th { color: var(--text3); }

        /* ── Predecessor cell ───────────────────────────────────────────────── */
        .pred-cell {
            min-width: 70px;
            max-width: 120px;
            cursor: pointer;
        }
        .pred-display {
            display: block;
            font-size: 12px;
            font-family: monospace;
            color: var(--accent);
            cursor: pointer;
            padding: 2px 4px;
            border-radius: 3px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .pred-display:hover {
            background: var(--surface);
            color: var(--text);
        }
        .pred-empty {
            color: var(--text3);
            font-family: inherit;
        }
        .pred-input {
            width: 100%;
            background: var(--bg);
            border: 1px solid var(--accent);
            border-radius: 3px;
            color: var(--text);
            padding: 2px 4px;
            font-size: 12px;
            font-family: monospace;
            outline: none;
            box-shadow: 0 0 0 2px rgba(79,128,255,.2);
        }
        .pred-input:focus { border-color: var(--accent); }

        /* ── Row selection ──────────────────────────────────────────────────── */
        #sched-body tr { cursor: pointer; }
        #sched-body tr.row-selected {
            background: rgba(79,128,255,.12) !important;
            outline: 1px solid rgba(79,128,255,.3);
        }

        /* ── Disabled topbar button ─────────────────────────────────────────── */
        .tb-btn:disabled {
            opacity: 0.35;
            cursor: not-allowed;
            pointer-events: none;
        }

        /* ── Gantt row selection ────────────────────────────────────────────── */
        .g-row { transition: background 0.1s; }
        .g-row-selected {
            background: rgba(79,128,255,.13) !important;
            outline: 1px solid rgba(79,128,255,.35);
        }

        /* ── Dependency line overlay ────────────────────────────────────────── */
        .g-dep-overlay { pointer-events: none; }