/* Pipeline page styles
 * Extracted from pipeline.html without behavior or visual changes.
 * Next refactor pass can split this file by feature once smoke-tested.
 */



/* ---- extracted style block 1 ---- */
        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Inter', sans-serif;
            background: #f0f2f5;
            color: #1a1a2e;
            display: flex;
            min-height: 100vh;
            overflow-x: hidden;
        }
        /* --- MAIN ----------------------------------------------- */
        .main {
            margin-left: 240px;
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        .top-bar {
            background: white;
            border-bottom: 1px solid #e2e5ea;
            padding: 16px 28px;
        }

        .page-title {
            font-size: 20px;
            font-weight: 800;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: #0f172a;
        }

        .greeting { font-size: 17px; font-weight: 600; color: #0f172a; margin-top: 5px; }
        .greeting-date { font-size: 12px; color: #6b7280; margin-top: 2px; }

        /* --- CONTENT -------------------------------------------- */
        .content { padding: 24px 28px 40px; }

        /* --- PIPELINE TABLE WRAPPER ----------------------------- */
        .table-card {
            background: white;
            border-radius: 10px;
            border: 1px solid #e2e5ea;
            overflow: hidden;
        }

        .table-header-bar {
            display: flex;
            flex-direction: column;
            gap: 16px;
            padding: 18px 20px;
            border-bottom: 1px solid #e2e5ea;
            background:
                radial-gradient(circle at top left, rgba(81, 112, 255, 0.12), transparent 34%),
                linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
        }

        .table-header-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 18px;
        }

        .table-header-copy {
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-width: 0;
            flex: 1;
        }

        .table-title-row {
            display: flex;
            align-items: baseline;
            gap: 10px;
            flex-wrap: wrap;
        }

        .table-title {
            font-size: 20px;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.02em;
        }

        .table-meta {
            font-size: 12px;
            color: #667085;
            font-weight: 600;
            margin-top: 0;
            display: none;
        }

.pipeline-overview-grid {
            display: grid;
            grid-template-columns: minmax(720px, 1fr) minmax(420px, 520px);
            gap: 16px;
            align-items: stretch;
        }

        .pipeline-stat-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(165px, 1fr));
            gap: 12px;
            align-items: stretch;
        }

        .pipeline-stage-panel {
            border-radius: 15px;
            border: 1px solid rgba(209, 219, 255, 0.95);
            background: rgba(255,255,255,0.92);
            box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
            padding: 14px 15px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-height: 118px;
            max-height: 275px;
            width: 100%;
            max-width: none;
        }

        .pipeline-stat-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(165px, 1fr));
            gap: 12px;
            align-items: stretch;
        }

        .pipeline-stage-panel {
            border-radius: 15px;
            border: 1px solid rgba(209, 219, 255, 0.95);
            background: rgba(255,255,255,0.92);
            box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
            padding: 14px 15px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-height: 118px;
            max-height: 275px;
            width: 100%;
            max-width: none;
        }

        .pipeline-stat-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(165px, 1fr));
            gap: 12px;
            align-items: stretch;
        }

        .pipeline-health-card {
            position: relative;
            padding: 16px 18px;
            border-radius: 15px;
            background: rgba(255,255,255,0.92);
            border: 1px solid rgba(209, 219, 255, 0.95);
            box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
            overflow: hidden;
            min-height: 128px;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            gap: 8px;
        }

        .pipeline-health-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: var(--accent-color);
        }

        .pipeline-health-card.attention::before { background: #d97706; }
        .pipeline-health-card.docs::before { background: #7c3aed; }
        .pipeline-health-card.closing::before { background: #0f766e; }
        .pipeline-health-card.volume::before { background: #1d4ed8; }

        .pipeline-health-label {
            position: relative;
            display: block;
            font-size: 11px;
            line-height: 1.1;
            font-weight: 800;
            letter-spacing: 0.13em;
            text-transform: uppercase;
            color: #6b7280;
            margin-bottom: 0;
        }

        .pipeline-health-value {
            position: relative;
            display: block;
            font-size: 30px;
            line-height: 1;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.03em;
        }

        .pipeline-health-note {
            position: relative;
            display: block;
            margin-top: 0;
            font-size: 13px;
            font-weight: 600;
            color: #667085;
            line-height: 1.35;
            max-width: 24ch;
        }

        .pipeline-health-value {
            position: relative;
            display: block;
            font-size: 30px;
            line-height: 1;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.03em;
        }

        .pipeline-health-note {
            position: relative;
            display: block;
            margin-top: 0;
            font-size: 13px;
            font-weight: 600;
            color: #667085;
            line-height: 1.35;
            max-width: 24ch;
        }

        .pipeline-health-value {
            position: relative;
            display: block;
            font-size: 30px;
            line-height: 1;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.03em;
        }

        .pipeline-health-note {
            position: relative;
            display: block;
            margin-top: 0;
            font-size: 13px;
            font-weight: 600;
            color: #667085;
            line-height: 1.35;
            max-width: 24ch;
        }

        .pipeline-health-value {
            position: relative;
            display: block;
            font-size: 30px;
            line-height: 1;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.03em;
        }

        .pipeline-health-note {
            position: relative;
            display: block;
            margin-top: 0;
            font-size: 13px;
            font-weight: 600;
            color: #667085;
            line-height: 1.35;
            max-width: 24ch;
        }

        .volume-value {
            font-size: 28px;
            letter-spacing: -0.04em;
        }

        .pipeline-stage-panel {
            border-radius: 15px;
            border: 1px solid rgba(209, 219, 255, 0.95);
            background: rgba(255,255,255,0.92);
            box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
            padding: 14px 15px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-height: 118px;
            max-height: 275px;
        }

        .pipeline-stage-title {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: #6b7280;
        }

        .pipeline-stage-meta {
            margin-top: 5px;
            font-size: 11.5px;
            font-weight: 600;
            color: #667085;
            line-height: 1.4;
        }

        .pipeline-stage-rows {
            display: flex;
            flex-direction: column;
            gap: 8px;
            overflow-y: auto;
            flex: 1 1 auto;
            min-height: 0;
        }

        .pipeline-stage-row {
            display: grid;
            grid-template-columns: 140px 1fr auto;
            align-items: center;
            gap: 10px;
        }

        .pipeline-stage-label {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            min-width: 0;
            font-size: 11.5px;
            font-weight: 700;
            color: #0f172a;
        }

        .pipeline-stage-label-text {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .pipeline-stage-dot {
            width: 8px;
            height: 8px;
            border-radius: 999px;
            flex-shrink: 0;
            background: #94a3b8;
        }

        .pipeline-stage-bar {
            position: relative;
            height: 8px;
            border-radius: 999px;
            background: #e7ecf7;
            overflow: hidden;
        }

        .pipeline-stage-bar-fill {
            position: absolute;
            inset: 0 auto 0 0;
            border-radius: inherit;
            min-width: 0;
            background: linear-gradient(90deg, rgba(81, 112, 255, 0.92), rgba(81, 112, 255, 0.58));
        }

        .pipeline-stage-count {
            font-size: 11.5px;
            font-weight: 800;
            color: #334155;
        }

        .pipeline-stage-empty {
            padding: 6px 0 2px;
            font-size: 12px;
            color: #667085;
        }

        .table-actions {
            display: flex;
            gap: 8px;
            align-self: flex-start;
        }

        .btn {
            padding: 7px 14px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            font-family: 'Inter', sans-serif;
        }

        .btn-primary {
            background: var(--accent-color);
            color: white;
            box-shadow: 0 10px 20px rgba(81, 112, 255, 0.22);
        }

        .btn-secondary {
            background: #f1f3f5;
            color: #374151;
            border: 1px solid #e2e5ea;
        }

        .btn-primary:hover {
            background: #4263eb;
        }

        /* Generic modal styles used by pipeline modals (EOI request, message review, credit link, Full File, worklist, processor) */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.4);
            z-index: 500;
            align-items: center;
            justify-content: center;
        }
        .modal-overlay.open { display: flex; }

        .modal-close {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #9ca3af;
            line-height: 1;
            padding: 0 4px;
        }
        .modal-close:hover { color: white; }

        /* Funded/Closed loans are now rendered inline in the pipeline table (no modal). */

        /* --- TABLE ---------------------------------------------- */
        .table-scroll { overflow-x: auto; }

        #pipelineTable {
            width: 100%;
            table-layout: fixed;
            border-collapse: collapse;
            min-width: 1740px;
        }

        thead tr {
            background: var(--primary-color);
        }

        thead th {
            padding: 13px 14px;
            text-align: center;
            font-size: 12px;
            font-weight: 700;
            color: white;
            letter-spacing: 0.03em;
            white-space: nowrap;
        }

        thead th:first-child { text-align: center; }

        #pipelineTable thead th:first-child { text-align: center; }

        /* Pipeline table column alignment */
        #pipelineTable thead th.col-start-date,
        #pipelineTable tbody td.col-start-date { text-align: left; }
        #pipelineTable thead th.col-borrower,
        #pipelineTable tbody td.col-borrower { text-align: left; }
        #pipelineTable thead th.col-property,
        #pipelineTable tbody td.col-property { text-align: left; }
        #pipelineTable thead th.col-type,
        #pipelineTable tbody td.col-type { text-align: left; }
        #pipelineTable thead th.col-stage,
        #pipelineTable tbody td.col-stage { text-align: center; }
        #pipelineTable thead th.col-lender,
        #pipelineTable tbody td.col-lender { text-align: left; }
        #pipelineTable thead th.col-program,
        #pipelineTable tbody td.col-program { text-align: left; }
        #pipelineTable thead th.col-appraisal,
        #pipelineTable tbody td.col-appraisal { text-align: center; }
        #pipelineTable thead th.col-broker,
        #pipelineTable tbody td.col-broker { text-align: left; }
        #pipelineTable thead th.col-loan-amount,
        #pipelineTable tbody td.col-loan-amount { text-align: right; }
        #pipelineTable thead th.col-loan-number,
        #pipelineTable tbody td.col-loan-number { text-align: right; }

        #pipelineTable col.col-date { width: 145px; }
        #pipelineTable col.col-borrower { width: 170px; }
        #pipelineTable col.col-address { width: 300px; }
        #pipelineTable col.col-type { width: 160px; }
        #pipelineTable col.col-stage { width: 125px; }
        #pipelineTable col.col-lender { width: 150px; }
        #pipelineTable col.col-program { width: 190px; }
        #pipelineTable col.col-appraisal { width: 145px; }
        #pipelineTable col.col-broker { width: 110px; }
        #pipelineTable col.col-loan-amount { width: 120px; }
        #pipelineTable col.col-loan-number { width: 125px; }

        #scenarios-table thead th:first-child {
            width: 200px;
            text-align: left;
        }

        #pipelineTable tbody td.col-appraisal {
            white-space: nowrap;
        }

        tbody tr {
            border-bottom: 1px solid #e8eaed;
            transition: background 0.1s;
        }

        tbody tr:nth-child(even) { background: #f4f6fb; }
        tbody tr:nth-child(odd)  { background: white; }
        tbody tr:hover            { background: #eef1ff; }

        tbody td {
            padding: 12px 14px;
            font-size: 12.5px;
            color: #374151;
            text-align: center;
            white-space: nowrap;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        tbody td:first-child {
            white-space: nowrap;
        }

        .td-borrower {
            font-weight: 700;
            color: #0f172a;
            text-align: left !important;
        }

        .td-borrower .cell-text,
        .td-address .cell-text,
        .td-lender .cell-text,
        .td-program .cell-text,
        .col-broker .cell-text,
        .col-loan-number .cell-text,
        .col-loan-amount .cell-text,
        #pipelineTable td > .cell-text {
            display: block;
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cell-subtext {
            font-size: 11px;
            font-weight: 500;
            color: #9ca3af;
            margin-top: 2px;
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #pipelineTable tbody td.col-start-date .cell-subtext {
            overflow: visible;
            text-overflow: clip;
            white-space: nowrap;
        }

        .td-address {
            text-align: left !important;
            color: #4b5563;
        }

        .td-lender  { color: var(--accent-color); font-weight: 500; }
        .td-program { color: var(--accent-color); font-weight: 500; }

        /* --- STAGE BADGE & DROPDOWN ---------------------------- */
        #pipelineTable tbody td.stage-cell {
            position: relative;
            overflow: visible;
        }

        .stage-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            flex-shrink: 0;
            white-space: nowrap;
            cursor: pointer;
            user-select: none;
            transition: opacity 0.12s;
        }

        .stage-badge:hover { opacity: 0.82; }

        .stage-badge.is-editable::after {
            content: '\25BE';
            font-size: 9px;
            opacity: 0.72;
            margin-left: 1px;
        }

        .stage-badge.is-saving {
            opacity: 0.65;
            pointer-events: none;
        }

        .stage-documents        { background: #dbeafe; color: #1d4ed8; }
        .stage-processing       { background: #fef9c3; color: #854d0e; }
        .stage-underwriting     { background: #1565c0; color: #ffffff; }
        .stage-approved         { background: #dcfce7; color: #15803d; }
        .stage-closing          { background: #ffedd5; color: #9a3412; }
        .stage-funded           { background: #d1fae5; color: #065f46; }
        .stage-submitted        { background: #fff176; color: #333333; }
        .stage-conditions       { background: #d4a017; color: #ffffff; }
        .stage-prep-ctc         { background: #00bcd4; color: #ffffff; }
        .stage-ctc              { background: #4caf50; color: #ffffff; }
        .stage-funded-closed    { background: #2e7d32; color: #ffffff; }
        .stage-to-be-submitted  { background: #9e9e9e; color: #ffffff; }
        .stage-on-hold          { background: #ef5350; color: #ffffff; }

        /* Dropdown menu */
        .stage-menu {
            display: none;
            position: absolute;
            top: calc(100% + 4px);
            left: 50%;
            transform: translateX(-50%);
            background: white;
            border: 1px solid #e2e5ea;
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            z-index: 999;
            min-width: 150px;
            padding: 4px;
            text-align: left;
        }

        .stage-menu.open { display: block; }

        #pipelineTable tbody td.appraisal-cell {
            position: relative;
            overflow: visible;
        }

        .appraisal-display {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            user-select: none;
            padding: 4px 10px;
            border-radius: 999px;
            border: 1px solid #dbe2ee;
            background: #f8fafc;
            font-size: 12px;
            font-weight: 600;
            color: #1f2937;
            transition: background 0.12s;
            flex-shrink: 0;
            white-space: nowrap;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .appraisal-display:hover { background: #f3f4f6; }

        .appraisal-display::after {
            content: '\25BC';
            font-size: 8px;
            opacity: 0.5;
        }

        .appraisal-menu {
            display: none;
            position: absolute;
            top: calc(100% + 2px);
            left: 50%;
            transform: translateX(-50%);
            background: white;
            border: 1px solid #e2e5ea;
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            z-index: 999;
            min-width: 172px;
            padding: 4px;
            text-align: left;
        }

        .appraisal-menu.open { display: block; }

        .appraisal-option {
            padding: 7px 10px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 500;
            color: #374151;
            cursor: pointer;
            transition: background 0.1s;
        }

        .appraisal-option:hover { background: #f3f4f6; }

        .appraisal-option.selected { color: var(--accent-color); font-weight: 600; }

        .stage-option {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 10px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 500;
            color: #374151;
            cursor: pointer;
            transition: background 0.1s;
        }

        .stage-option:hover { background: #f4f6fb; }

        .stage-option .dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        /* --- SCENARIOS VIEW ------------------------------------ */
        .scenarios-empty {
            padding: 48px 24px;
            text-align: center;
            color: #9ca3af;
            font-size: 13px;
        }

        .submit-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 6px;
            border: 1px solid #c7d0ff;
            background: #eef1ff;
            color: var(--accent-color);
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.12s, color 0.12s, border-color 0.12s;
        }

        .submit-btn:hover { background: #dde3ff; border-color: #a5b0ff; }

        .credit-link-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 6px;
            border: 1px solid #e2e5ea;
            background: #f1f3f5;
            color: #374151;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.12s, border-color 0.12s;
        }

        .credit-link-btn:hover { background: #e6e9ee; border-color: #d0d5dd; }

        .term-sheet-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 6px;
            border: 1px solid #e2e5ea;
            background: #f1f3f5;
            color: #374151;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.12s, border-color 0.12s;
        }

        .term-sheet-btn:hover { background: #e6e9ee; border-color: #d0d5dd; }

        .submit-btn:disabled,
        .credit-link-btn:disabled,
        .term-sheet-btn:disabled,
        .doc-upload-btn:disabled,
        .btn-save:disabled,
        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* --- ROW ACTION BUTTONS -------------------------------- */
        .row-btn {
            display: inline-flex;
            align-items: center;
            padding: 3px 9px;
            border-radius: 5px;
            border: 1.5px solid #e2e5ea;
            background: #f8f9fb;
            color: #374151;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            font-family: 'Inter', sans-serif;
            transition: all 0.12s;
        }
        .row-btn:hover { border-color: var(--accent-color); background: #eef1ff; color: var(--accent-color); }
        .row-btn-actions { display: flex; align-items: center; gap: 5px; }

        tbody tr.worklist-row td:first-child {
            white-space: nowrap;
            min-width: 0;
            border-left: 4px solid transparent;
            padding-left: 10px;
        }

        tbody tr.worklist-row-critical td:first-child { border-left-color: #dc2626; }
        tbody tr.worklist-row-warning td:first-child { border-left-color: #d97706; }

        tbody tr.pipeline-row-needs-attention td {
            animation: pipelineNeedsAttentionPulse 2.8s ease-in-out infinite;
        }

        tbody tr.pipeline-row-needs-attention td:first-child {
            box-shadow: inset 4px 0 0 #dc2626, inset 12px 0 18px rgba(96, 165, 250, 0.12);
        }

        tbody tr.pipeline-row-needs-attention:hover td {
            animation: none;
            background-color: #eef1ff;
        }

        @keyframes pipelineNeedsAttentionPulse {
            0%, 100% {
                background-color: rgba(96, 165, 250, 0.03);
                box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.04);
            }
            45% {
                background-color: rgba(96, 165, 250, 0.08);
                box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.16), 0 0 14px rgba(96, 165, 250, 0.14);
            }
        }

        @media (prefers-reduced-motion: reduce) {
            tbody tr.pipeline-row-needs-attention td {
                animation: none;
                background-color: rgba(96, 165, 250, 0.05);
                box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.08);
            }

            tbody tr.pipeline-row-needs-attention td:first-child {
                box-shadow: inset 4px 0 0 #dc2626, inset 12px 0 18px rgba(96, 165, 250, 0.1);
            }
        }

        tbody tr.urgency-divider-row,
        tbody tr.urgency-divider-row:hover {
            background: transparent !important;
        }

        tbody tr.urgency-divider-row td {
            padding: 10px 14px 6px;
            border-bottom: none;
            background: transparent !important;
            text-align: left;
        }

        tbody tr.urgency-divider-row.urgency-divider-after-needs-attention td {
            padding-top: 24px;
        }

        tbody tr.urgency-divider-row.empty-band td {
            padding-bottom: 4px;
        }

        .urgency-divider {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #64748b;
        }

        .urgency-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: #dbe2ea;
        }

        .urgency-divider.critical { color: #b91c1c; }
        .urgency-divider.critical::after {
            background: linear-gradient(90deg, rgba(220, 38, 38, 0.28), rgba(219, 226, 234, 0.92));
        }

        .urgency-divider.warning { color: #b45309; }
        .urgency-divider.warning::after {
            background: linear-gradient(90deg, rgba(217, 119, 6, 0.28), rgba(219, 226, 234, 0.92));
        }

        .urgency-divider.fresh { color: #0f766e; }
        .urgency-divider.fresh::after {
            background: linear-gradient(90deg, rgba(15, 118, 110, 0.24), rgba(219, 226, 234, 0.92));
        }

        .urgency-divider.pipeline { color: #1d4ed8; }
        .urgency-divider.pipeline::after {
            background: linear-gradient(90deg, rgba(37, 99, 235, 0.24), rgba(219, 226, 234, 0.92));
        }

        .urgency-divider.funded { color: #065f46; }
        .urgency-divider.funded::after {
            background: linear-gradient(90deg, rgba(5, 150, 105, 0.24), rgba(219, 226, 234, 0.92));
        }

        .urgency-divider-count {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.02em;
            text-transform: none;
            color: #64748b;
        }

        /* --- FULL FILE MODAL ------------------------------------ */
        .ff-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 600;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .ff-overlay.open { display: flex; }

        .ff-modal {
            background: white;
            border-radius: 12px;
            width: 100%;
            max-width: 1160px;
            max-height: 95vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 24px 64px rgba(0,0,0,0.22);
            overflow: hidden;
        }

        .ff-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 22px;
            border-bottom: 1px solid #e2e5ea;
            flex-shrink: 0;
            background: #fff;
        }
        .ff-header-title { font-size: 15px; font-weight: 700; color: #0f172a; }
        .ff-header-sub   { font-size: 11.5px; color: #6b7280; margin-top: 2px; }
        .ff-header-right { display: flex; align-items: center; gap: 8px; }

        .ff-body {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* Left summary sidebar */
        .ff-sidebar {
            width: 210px;
            flex-shrink: 0;
            border-right: 1px solid #f1f3f5;
            padding: 18px 16px;
            overflow-y: auto;
            background: #fafbfc;
        }
        .ff-sidebar-label {
            font-size: 9.5px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: #9ca3af;
            margin-bottom: 10px;
        }
        .ff-stat { margin-bottom: 12px; }
        .ff-stat-key { font-size: 10.5px; color: #6b7280; font-weight: 500; margin-bottom: 2px; }
        .ff-stat-val { font-size: 13px; font-weight: 700; color: #0f172a; }

        /* Right content area */
        .ff-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

        /* Tabs */
        .ff-tabs {
            display: flex;
            gap: 0;
            border-bottom: 1px solid #e2e5ea;
            flex-shrink: 0;
            padding: 0 20px;
            background: #fff;
        }
        .ff-tab {
            padding: 11px 16px;
            font-size: 12.5px;
            font-weight: 600;
            color: #6b7280;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            margin-bottom: -1px;
            transition: color 0.12s;
            white-space: nowrap;
        }
        .ff-tab:hover { color: #0f172a; }
        .ff-tab.active { color: var(--accent-color); border-bottom-color: var(--accent-color); }

        /* Tab panels */
        .ff-panel { display: none; flex: 1; overflow-y: auto; padding: 20px; }
        .ff-panel.active { display: block; }

        /* Section headings inside panels */
        .ff-section-title {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #6b7280;
            margin: 0 0 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #f1f3f5;
        }

        /* Doc rows */
        .doc-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 9px 12px;
            border: 1px solid #e2e5ea;
            border-radius: 8px;
            margin-bottom: 7px;
            background: #fafbfc;
        }
        .doc-row-name { font-size: 12.5px; font-weight: 600; color: #0f172a; }
        .doc-row-status { font-size: 11px; color: #9ca3af; margin-top: 2px; }
        .doc-upload-btn {
            padding: 4px 11px;
            border-radius: 5px;
            border: 1.5px solid #e2e5ea;
            background: white;
            font-size: 11px;
            font-weight: 600;
            color: #374151;
            cursor: pointer;
            font-family: 'Inter', sans-serif;
            transition: all 0.12s;
        }
        .doc-upload-btn:hover { border-color: var(--accent-color); color: var(--accent-color); background: #eef1ff; }
        .doc-upload-btn.uploaded { border-color: #10b981; color: #059669; background: #ecfdf5; }
        .doc-delete-btn {
            width: 22px; height: 22px; border-radius: 5px; border: 1px solid #fecaca;
            background: #fff5f5; color: #ef4444; cursor: pointer; font-size: 12px;
            display: flex; align-items: center; justify-content: center;
            margin-left: 6px; flex-shrink: 0; transition: all 0.12s;
        }
        .doc-delete-btn:hover { background: #fee2e2; border-color: #ef4444; }
        .doc-delete-btn:disabled { opacity: 0.55; cursor: not-allowed; }

        /* Add File button + inline row */
        .ff-add-file-btn {
            display: flex; align-items: center; gap: 6px;
            padding: 7px 13px; border-radius: 8px;
            border: 1.5px dashed #d1d5db; background: white;
            color: #6b7280; font-size: 12px; font-weight: 600;
            cursor: pointer; font-family: 'Inter', sans-serif;
            width: 100%; margin-top: 8px; transition: all 0.12s;
        }
        .ff-add-file-btn:hover { border-color: var(--accent-color); color: var(--accent-color); background: #eef1ff; }
        .ff-add-file-btn svg { width: 13px; height: 13px; }
        .ff-upload-zone {
            margin-top: 10px;
            border: 1.5px dashed #cbd5e1;
            border-radius: 10px;
            background: #f8fafc;
            padding: 16px;
            text-align: center;
            transition: all 0.12s;
        }
        .ff-upload-zone.dragover {
            border-color: var(--accent-color);
            background: #eef2ff;
        }
        .ff-upload-zone-title {
            font-size: 12.5px;
            font-weight: 700;
            color: #0f172a;
        }
        .ff-upload-zone-copy {
            margin-top: 4px;
            font-size: 11.5px;
            color: #64748b;
            line-height: 1.45;
        }
        .ff-upload-zone-actions {
            margin-top: 10px;
            display: flex;
            justify-content: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .ff-upload-browse-btn {
            padding: 7px 12px;
            border-radius: 8px;
            border: 1px solid #c7d2fe;
            background: white;
            color: #3730a3;
            font-size: 11.5px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.12s;
        }
        .ff-upload-browse-btn:hover {
            border-color: var(--accent-color);
            background: #eef2ff;
            color: #4338ca;
        }
        .ff-upload-zone-note {
            margin-top: 8px;
            font-size: 10.5px;
            color: #94a3b8;
        }
        .ff-tab-action {
            margin-top: 10px;
            display: flex;
            justify-content: flex-start;
        }
        .ff-secondary-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 12px 18px;
            min-height: 46px;
            border-radius: 10px;
            border: 1.5px solid #c7d2fe;
            background: #eef2ff;
            color: #3730a3;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.12s;
            box-shadow: 0 8px 20px rgba(79, 70, 229, 0.12);
        }
        .ff-secondary-btn:hover {
            border-color: var(--accent-color);
            background: #e0e7ff;
            color: #312e81;
        }
        #eoiRequestModal {
            z-index: 750;
        }
        .ff-add-inline {
            display: flex; gap: 6px; align-items: center;
            margin-top: 8px; padding: 9px 12px;
            border: 1.5px solid var(--accent-color); border-radius: 8px; background: #fafbff;
        }
        .ff-add-inline input {
            flex: 1; border: none; outline: none; background: transparent;
            font-size: 12.5px; font-family: 'Inter', sans-serif; color: #0f172a;
        }
        .ff-add-inline input::placeholder { color: #b0b7c3; }
        .ff-inline-save {
            padding: 4px 11px; border-radius: 6px; border: none;
            background: var(--accent-color); color: white; font-size: 11.5px; font-weight: 600;
            cursor: pointer; font-family: 'Inter', sans-serif; white-space: nowrap;
        }
        .ff-inline-cancel {
            padding: 4px 8px; border-radius: 6px; border: 1px solid #e2e5ea;
            background: white; color: #6b7280; font-size: 11.5px; font-weight: 600;
            cursor: pointer; font-family: 'Inter', sans-serif;
        }

        /* Info form fields inside Full File */
        .ff-field { margin-bottom: 14px; }
        .ff-field label { display: block; font-size: 11px; font-weight: 600; color: #6b7280; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
        .ff-field input {
            width: 100%;
            padding: 7px 10px;
            border: 1.5px solid #e2e5ea;
            border-radius: 6px;
            font-size: 12.5px;
            font-family: 'Inter', sans-serif;
            color: #0f172a;
            outline: none;
            transition: border-color 0.12s;
        }
        .ff-field input:focus { border-color: var(--accent-color); }
        .ff-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
        .ff-summary-shell {
            display: flex;
            flex-direction: column;
            gap: 18px;
        }
        .ff-summary-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 16px;
        }
        .ff-summary-card {
            border: 1px solid #e2e5ea;
            border-radius: 10px;
            background: #fafbfc;
            padding: 14px;
        }
        .ff-summary-card-title {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #6b7280;
            margin-bottom: 10px;
        }
        .ff-summary-list {
            display: flex;
            flex-direction: column;
            gap: 9px;
        }
        .ff-summary-item {
            display: grid;
            grid-template-columns: 126px minmax(0, 1fr);
            gap: 10px;
            align-items: start;
        }
        .ff-summary-key {
            font-size: 11px;
            font-weight: 600;
            color: #6b7280;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .ff-summary-val {
            font-size: 12.5px;
            color: #0f172a;
            line-height: 1.45;
            word-break: break-word;
        }
        .ff-summary-empty {
            padding: 14px;
            border: 1px dashed #d1d5db;
            border-radius: 10px;
            background: #fff;
            font-size: 12.5px;
            color: #6b7280;
        }

        /* FF Readiness Bar */
        .ff-readiness-bar {
            background: #f8f9fb;
            border: 1px solid #e2e5ea;
            border-radius: 10px;
            padding: 14px;
            margin-bottom: 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .ff-readiness-stats {
            display: flex;
            flex-wrap: wrap;
            gap: 6px 16px;
        }
        .ff-readiness-stat {
            font-size: 12px;
            color: #475569;
        }
        .ff-readiness-stat strong {
            color: #0f172a;
        }
        .ff-readiness-verdict {
            font-size: 13px;
            font-weight: 700;
            padding: 6px 12px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            width: fit-content;
        }
        .ff-readiness-verdict.ready {
            background: #dcfce7;
            color: #166534;
        }
        .ff-readiness-verdict.not-ready {
            background: #fee2e2;
            color: #b91c1c;
        }

        /* FF Blocker Sections */
        .ff-blockers-section,
        .ff-accepted-section {
            margin-bottom: 16px;
        }
        .ff-blocker-group {
            border: 1px solid #e2e5ea;
            border-radius: 8px;
            margin-bottom: 10px;
            overflow: hidden;
        }
        .ff-blocker-group-header {
            padding: 8px 12px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .ff-blocker-group-header.rejected { background: #fef2f2; color: #b91c1c; }
        .ff-blocker-group-header.pending-review { background: #f5f3ff; color: #6d28d9; }
        .ff-blocker-group-header.missing { background: #f1f5f9; color: #475569; }
        .ff-blocker-group-body { padding: 0; }

        /* FF Accepted section */
        .ff-accepted-header {
            padding: 8px 0;
            font-size: 12px;
            font-weight: 700;
            color: #166534;
            margin-bottom: 8px;
        }

        /* FF Doc Row (refined for submission view) */
        .ff-submission-doc-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            border-bottom: 1px solid #f1f5f9;
            gap: 10px;
        }
        .ff-submission-doc-row:last-child {
            border-bottom: none;
        }
        .ff-submission-doc-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
            flex: 1;
        }
        .ff-submission-doc-name {
            font-size: 12.5px;
            font-weight: 600;
            color: #0f172a;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .ff-submission-doc-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 4px 8px;
            font-size: 11px;
            color: #6b7280;
        }
        .ff-submission-doc-actions {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
            align-items: center;
        }
        .ff-download-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 5px 10px;
            border-radius: 6px;
            border: 1.5px solid #d1d5db;
            background: #fff;
            color: #0f172a;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.12s;
            text-decoration: none;
        }
        .ff-download-btn:hover {
            background: #f1f5f9;
            border-color: #9ca3af;
        }
        .ff-submission-note {
            font-size: 11.5px;
            color: #6b7280;
            padding: 10px 12px;
            background: #f8f9fb;
            border-radius: 8px;
            border: 1px dashed #d1d5db;
            margin-top: 8px;
            line-height: 1.5;
        }

        /* --- EDIT BUTTON ---------------------------------------- */
        .edit-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border: 1px solid #e2e5ea;
            border-radius: 6px;
            background: #f8f9fb;
            cursor: pointer;
            transition: all 0.12s;
            color: #6b7280;
        }

        .edit-btn:hover {
            background: #eef1ff;
            border-color: var(--accent-color);
            color: var(--accent-color);
        }
        .edit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

        .edit-btn svg {
            width: 13px;
            height: 13px;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* --- DELETE BUTTON --------------------------------------- */
        .delete-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 4px 10px;
            border-radius: 6px;
            border: 1px solid #fecaca;
            background: #fef2f2;
            color: #dc2626;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.12s, border-color 0.12s;
        }

        .delete-btn:hover {
            background: #fee2e2;
            border-color: #fca5a5;
        }

        .empty-row td {
            height: 44px;
            background: white;
        }

        /* --- FILTER BAR ----------------------------------------- */
        .filter-bar {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 20px;
            border-bottom: 1px solid #e2e5ea;
            flex-wrap: wrap;
        }

        .filter-search-wrap {
            position: relative;
            flex: 1;
            min-width: 200px;
            max-width: 320px;
        }

        .filter-search-wrap svg {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            stroke: #9ca3af;
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            pointer-events: none;
        }

        .filter-search {
            width: 100%;
            padding: 7px 12px 7px 32px;
            border: 1px solid #e2e5ea;
            border-radius: 7px;
            font-size: 12.5px;
            font-family: 'Inter', sans-serif;
            color: #0f172a;
            background: #f8f9fb;
            outline: none;
            transition: border-color 0.12s, background 0.12s;
        }

        .filter-search:focus { border-color: var(--accent-color); background: white; }

        .filter-divider {
            width: 1px;
            height: 22px;
            background: #e2e5ea;
            flex-shrink: 0;
        }

        .filter-label {
            font-size: 11px;
            font-weight: 600;
            color: #9ca3af;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            white-space: nowrap;
        }

        .filter-pills {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
        }

        .filter-stage-group {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            min-width: 0;
        }

        .filter-pill {
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            border: 1.5px solid #e2e5ea;
            color: #6b7280;
            background: white;
            transition: all 0.12s;
            white-space: nowrap;
        }

        .filter-pill:hover { border-color: var(--accent-color); color: var(--accent-color); }
        .filter-pill.active { background: var(--accent-color); border-color: var(--accent-color); color: white; }

        .filter-select {
            padding: 5px 10px;
            border: 1.5px solid #e2e5ea;
            border-radius: 7px;
            font-size: 12px;
            font-family: 'Inter', sans-serif;
            color: #374151;
            background: white;
            outline: none;
            cursor: pointer;
            transition: border-color 0.12s;
        }

        .filter-select:focus { border-color: var(--accent-color); }
        .filter-select.active { border-color: var(--accent-color); color: var(--accent-color); background: #f5f7ff; }

        .filter-overflow-wrap {
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .filter-overflow-label {
            font-size: 11.5px;
            font-weight: 700;
            color: #475569;
            white-space: nowrap;
        }

        .filter-select.stage-overflow {
            min-width: 170px;
            padding-right: 30px;
            appearance: none;
            background:
                linear-gradient(45deg, transparent 50%, #94a3b8 50%),
                linear-gradient(135deg, #94a3b8 50%, transparent 50%),
                linear-gradient(to right, transparent, transparent);
            background-position:
                calc(100% - 16px) calc(50% - 2px),
                calc(100% - 11px) calc(50% - 2px),
                100% 0;
            background-size: 5px 5px, 5px 5px, 2.5em 2.5em;
            background-repeat: no-repeat;
        }

        .filter-clear {
            padding: 5px 10px;
            border-radius: 7px;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            background: #fee2e2;
            color: #dc2626;
            font-family: 'Inter', sans-serif;
            transition: background 0.12s;
            white-space: nowrap;
            display: none;
        }

        .filter-clear:hover { background: #fecaca; }
        .filter-clear.visible { display: block; }

        .filter-count {
            font-size: 11.5px;
            color: #9ca3af;
            white-space: nowrap;
            margin-left: auto;
        }

        .filter-count strong { color: #0f172a; }

        tr.hidden { display: none; }

        /* --- EDIT LOAN MODAL ------------------------------------ */
        .edit-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 600;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }

        .edit-overlay.open { display: flex; }

        .edit-modal {
            background: white;
            border-radius: 12px;
            width: 100%;
            max-width: 640px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.22);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .edit-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 22px;
            border-bottom: 1px solid #e2e5ea;
            background: var(--primary-color);
        }

        .edit-modal-title {
            font-size: 14px;
            font-weight: 700;
            color: white;
            letter-spacing: 0.03em;
        }

        .edit-modal-sub {
            font-size: 11px;
            color: rgba(255,255,255,0.5);
            margin-top: 2px;
        }

        .edit-modal-close {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.08);
            cursor: pointer;
            font-size: 14px;
            color: rgba(255,255,255,0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.12s;
        }

        .edit-modal-close:hover { background: rgba(220,38,38,0.6); color: white; border-color: transparent; }

        .edit-modal-body {
            padding: 22px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .form-row {
            display: grid;
            gap: 14px;
        }

        .form-row.cols-1 { grid-template-columns: minmax(0, 1fr); }
        .form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .form-row.cols-3 { grid-template-columns: repeat(3, minmax(120px, 1fr)); }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
            min-width: 0;
        }

        .form-label {
            font-size: 10.5px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: #6b7280;
        }

        .form-input, .form-select {
            padding: 9px 12px;
            border: 1px solid #e2e5ea;
            border-radius: 7px;
            font-size: 13px;
            font-family: 'Inter', sans-serif;
            color: #0f172a;
            background: white;
            outline: none;
            transition: border-color 0.12s, box-shadow 0.12s;
            width: 100%;
            min-width: 0;
        }

        .form-input:focus, .form-select:focus {
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(81,112,255,0.12);
        }

        .form-select { cursor: pointer; appearance: auto; }

        .edit-modal-footer {
            padding: 16px 22px;
            border-top: 1px solid #e2e5ea;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            background: #f8f9fb;
        }

        .edit-modal-footer-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-left: auto;
        }

        .btn-delete {
            padding: 10px 14px;
            border-radius: 8px;
            border: 1px solid #fecaca;
            background: #fff1f2;
            color: #b91c1c;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            font-family: 'Inter', sans-serif;
            transition: background 0.12s, border-color 0.12s, color 0.12s;
        }

        .btn-delete:hover {
            background: #ffe4e6;
            border-color: #f87171;
            color: #991b1b;
        }

        .btn-delete[hidden] {
            display: none;
        }

        .btn-cancel {
            padding: 8px 18px;
            border-radius: 7px;
            font-size: 12.5px;
            font-weight: 600;
            cursor: pointer;
            background: white;
            border: 1px solid #e2e5ea;
            color: #374151;
            font-family: 'Inter', sans-serif;
            transition: background 0.12s;
        }

        .btn-cancel:hover { background: #f1f3f5; }

        .btn-save {
            padding: 8px 20px;
            border-radius: 7px;
            font-size: 12.5px;
            font-weight: 700;
            cursor: pointer;
            background: var(--accent-color);
            border: none;
            color: white;
            font-family: 'Inter', sans-serif;
            transition: background 0.12s;
        }

        .btn-save:hover { background: #3d5ce6; }

        .worklist-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.52);
            z-index: 640;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }

        .worklist-overlay.open { display: flex; }

        .worklist-modal {
            width: 100%;
            max-width: 1080px;
            max-height: 92vh;
            background: white;
            border-radius: 16px;
            box-shadow: 0 32px 80px rgba(15, 23, 42, 0.24);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .worklist-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            padding: 20px 24px;
            border-bottom: 1px solid #e2e8f0;
            background:
                radial-gradient(circle at top left, rgba(81, 112, 255, 0.12), transparent 30%),
                linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
        }

        .worklist-kicker {
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--accent-color);
            margin-bottom: 6px;
        }

        .worklist-title {
            font-size: 24px;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.03em;
        }

        .worklist-sub {
            margin-top: 6px;
            font-size: 12.5px;
            color: #64748b;
            line-height: 1.45;
        }

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

        .worklist-open-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 9px 14px;
            border-radius: 9px;
            border: 1px solid #c7d2fe;
            background: #eef2ff;
            color: #3730a3;
            font-size: 12px;
            font-weight: 700;
            text-decoration: none;
            transition: all 0.12s;
        }

        .worklist-open-link:hover {
            background: #e0e7ff;
            border-color: #a5b4fc;
        }

        .worklist-body {
            padding: 22px 24px 24px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 18px;
        }

        .worklist-summary-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 12px;
        }

        .worklist-summary-card {
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            background: #f8fafc;
            padding: 14px;
        }

        .worklist-summary-label {
            display: block;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: #6b7280;
            margin-bottom: 8px;
        }

        .worklist-summary-value {
            display: block;
            font-size: 20px;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.03em;
        }

        .worklist-summary-note {
            display: block;
            margin-top: 6px;
            font-size: 11px;
            color: #64748b;
            line-height: 1.4;
        }

        .worklist-columns {
            display: grid;
            grid-template-columns: minmax(320px, 1fr) minmax(0, 1.25fr);
            gap: 18px;
            align-items: start;
        }

        .worklist-panel {
            border: 1px solid #e2e8f0;
            border-radius: 14px;
            background: white;
            padding: 18px;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
        }

        .worklist-panel-heading {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 14px;
        }

        .worklist-panel-title {
            font-size: 13px;
            font-weight: 800;
            color: #0f172a;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .worklist-panel-copy {
            font-size: 12px;
            color: #64748b;
            line-height: 1.45;
        }

        .worklist-inline-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 14px;
        }

        .worklist-helper {
            margin-top: 10px;
            font-size: 11.5px;
            color: #64748b;
            line-height: 1.45;
        }

        .worklist-doc-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .worklist-doc-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 12px;
            align-items: center;
            padding: 12px 14px;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            background: #f8fafc;
        }

        .worklist-doc-name {
            font-size: 12.5px;
            font-weight: 700;
            color: #0f172a;
        }

        .worklist-doc-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 6px;
        }

        .worklist-doc-actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 6px;
        }

        .worklist-chip {
            display: inline-flex;
            align-items: center;
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 10.5px;
            font-weight: 700;
            white-space: nowrap;
        }

        .worklist-chip.pending { background: #e0f2fe; color: #0369a1; }
        .worklist-chip.uploaded { background: #ede9fe; color: #6d28d9; }
        .worklist-chip.approved { background: #dcfce7; color: #166534; }
        .worklist-chip.rejected { background: #fee2e2; color: #b91c1c; }
        .worklist-chip.neutral { background: #e2e8f0; color: #475569; }

        .worklist-empty {
            padding: 18px;
            border: 1px dashed #cbd5e1;
            border-radius: 12px;
            background: #f8fafc;
            font-size: 12px;
            color: #64748b;
            line-height: 1.45;
        }

        .worklist-inline-note {
            margin-top: 8px;
            font-size: 11px;
            font-weight: 600;
            color: #475569;
        }

        .processor-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.58);
            z-index: 650;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }

        .processor-overlay.open { display: flex; }

        .processor-modal {
            width: 100%;
            max-width: 1320px;
            max-height: 94vh;
            background: white;
            border-radius: 18px;
            box-shadow: 0 32px 84px rgba(15, 23, 42, 0.24);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .processor-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            padding: 22px 24px 18px;
            border-bottom: 1px solid #e2e8f0;
            background:
                radial-gradient(circle at top left, rgba(81, 112, 255, 0.12), transparent 32%),
                linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
        }

        .processor-header-main {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .processor-kicker {
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--accent-color);
        }

        .processor-title {
            font-size: 26px;
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.03em;
            line-height: 1.05;
        }

        .processor-sub {
            font-size: 12.5px;
            color: #64748b;
            line-height: 1.5;
        }

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

        .processor-body {
            padding: 22px 24px 18px;
            display: grid;
            grid-template-columns: minmax(360px, 1fr) minmax(0, 1.5fr);
            gap: 18px;
            overflow: auto;
        }

        .processor-column {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .processor-card {
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            background: #ffffff;
            padding: 18px;
            display: flex;
            flex-direction: column;
            gap: 14px;
            min-width: 0;
        }

        .processor-card-heading {
            font-size: 10.5px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: #64748b;
        }

        .processor-summary-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 10px;
        }

        .processor-summary-item {
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 12px 13px;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            background: #f8fafc;
        }

        .processor-summary-label {
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #64748b;
        }

        .processor-summary-value {
            font-size: 13px;
            font-weight: 700;
            color: #0f172a;
            line-height: 1.45;
            word-break: break-word;
        }

        .processor-card-heading-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .processor-edit-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border: none;
            border-radius: 5px;
            background: transparent;
            cursor: pointer;
            transition: all 0.12s;
            color: #94a3b8;
            flex-shrink: 0;
        }

        .processor-edit-btn:hover {
            background: #eef1ff;
            color: var(--accent-color);
        }

        .processor-edit-btn svg {
            width: 12px;
            height: 12px;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .processor-summary-edit {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .processor-summary-edit-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .processor-summary-edit-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .processor-summary-edit-item.cols-2 {
            grid-column: 1 / -1;
        }

        .processor-summary-edit-label {
            font-size: 9.5px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #64748b;
        }

        .processor-summary-edit-input {
            padding: 7px 10px;
            border: 1px solid #e2e5ea;
            border-radius: 6px;
            font-size: 12.5px;
            font-family: 'Inter', sans-serif;
            color: #0f172a;
            background: white;
            outline: none;
            transition: border-color 0.12s, box-shadow 0.12s;
            width: 100%;
            min-width: 0;
        }

        .processor-summary-edit-input:focus {
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(81,112,255,0.12);
        }

        .processor-summary-edit textarea.processor-summary-edit-input {
            resize: vertical;
            min-height: 52px;
            line-height: 1.5;
        }

        .processor-summary-edit-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            padding-top: 4px;
        }

        .processor-summary-edit-actions .btn-cancel,
        .processor-summary-edit-actions .btn-save {
            padding: 6px 14px;
            font-size: 11.5px;
        }

        .processor-note-input {
            min-height: 118px;
            resize: vertical;
            line-height: 1.5;
        }

        .processor-task-input-wrap {
            position: relative;
            flex: 1;
            min-width: 0;
        }

        .processor-task-input {
            width: 100%;
            min-width: 0;
            border: 1.5px solid #dbe3ef;
            border-radius: 8px;
            padding: 9px 11px;
            font: inherit;
            font-size: 12.5px;
            color: #1f2937;
            background: #fff;
        }

        .processor-task-input:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(81, 112, 255, 0.12);
        }

        .processor-task-input:disabled {
            background: #f8fafc;
            color: #64748b;
            cursor: not-allowed;
        }

        .processor-task-mention-menu {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            right: 0;
            z-index: 20;
            border: 1px solid #dbe3ef;
            border-radius: 10px;
            background: #fff;
            box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
            overflow: hidden;
        }

        .processor-task-mention-item {
            width: 100%;
            border: none;
            background: transparent;
            text-align: left;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 12px;
            cursor: pointer;
            font: inherit;
        }

        .processor-task-mention-item:hover,
        .processor-task-mention-item.active {
            background: #eef4ff;
        }

        .processor-task-mention-name {
            font-size: 12.5px;
            font-weight: 600;
            color: #0f172a;
        }

        .processor-task-mention-role {
            font-size: 11px;
            color: #64748b;
        }

        .processor-task-mention-empty {
            padding: 10px 12px;
            font-size: 12px;
            color: #6b7280;
            background: #fff;
        }

        .processor-task-draft-meta {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 8px;
            min-height: 20px;
        }

        .processor-task-draft-label {
            font-size: 10.5px;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #94a3b8;
        }

        .processor-task-mention-chip {
            display: inline-flex;
            align-items: center;
            padding: 3px 8px;
            border-radius: 999px;
            background: #eef4ff;
            color: #1d4ed8;
            font-size: 11px;
            font-weight: 600;
        }

        .processor-control-actions {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }

        .processor-helper {
            font-size: 11.5px;
            color: #64748b;
            line-height: 1.5;
        }

        .processor-panel-shell {
            min-height: 100%;
        }

        .processor-tabs {
            display: flex;
            gap: 8px;
            border-bottom: 1px solid #e2e8f0;
            padding-bottom: 12px;
        }

        .processor-tab {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 8px 14px;
            border-radius: 999px;
            border: 1px solid #dbe3f0;
            background: #f8fafc;
            color: #475569;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.12s;
        }

        .processor-tab:hover {
            background: #eef2ff;
            border-color: #c7d2fe;
            color: #1d4ed8;
        }

        .processor-tab.active {
            background: var(--primary-color);
            border-color: var(--primary-color);
            color: white;
        }

        .processor-tab-panel {
            min-height: 340px;
        }

        .processor-doc-groups {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .processor-doc-group {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .processor-doc-group-title {
            font-size: 10.5px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #64748b;
        }

        .processor-activity-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .processor-activity-item {
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            background: #f8fafc;
            padding: 12px 14px;
        }

        .processor-activity-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 7px;
            font-size: 11px;
            color: #64748b;
        }

        .processor-activity-message {
            font-size: 13px;
            color: #0f172a;
            line-height: 1.5;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .processor-empty {
            padding: 18px;
            border: 1px dashed #cbd5e1;
            border-radius: 12px;
            background: #ffffff;
            color: #64748b;
            font-size: 12px;
            line-height: 1.55;
        }

        .processor-docs-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 0 12px;
            border-bottom: 1px solid #e2e8f0;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }

        .processor-pkg-select-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .processor-pkg-label {
            font-size: 10.5px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #64748b;
            white-space: nowrap;
        }

        .processor-pkg-select {
            padding: 5px 10px;
            border: 1.5px solid #e2e5ea;
            border-radius: 7px;
            font-size: 12px;
            font-family: 'Inter', sans-serif;
            color: #374151;
            background: white;
            outline: none;
            cursor: pointer;
            min-width: 160px;
        }

        .processor-pkg-select:focus {
            border-color: var(--accent-color);
        }

        .processor-upload-link-btn {
            font-size: 11.5px !important;
            padding: 6px 14px !important;
        }

        .processor-upload-link-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .processor-footer {
            padding: 16px 24px 20px;
            border-top: 1px solid #e2e8f0;
            background: #f8fafc;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            flex-wrap: wrap;
        }

        .processor-footer-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .processor-footer-danger {
            margin-left: auto;
        }

        @media (max-width: 1040px) {
            .pipeline-overview-grid {
                grid-template-columns: 1fr;
            }

            .pipeline-stat-grid {
                grid-template-columns: repeat(2, minmax(165px, 1fr));
            }

            .processor-body {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 760px) {
            .main {
                margin-left: 0;
                flex: 1;
            }

            .table-header-bar {
                align-items: stretch;
            }

            .table-header-top {
                flex-direction: column;
                align-items: stretch;
            }

            .pipeline-stat-grid {
                grid-template-columns: repeat(2, minmax(165px, 1fr));
            }

            .processor-body {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 760px) {
            .main {
                margin-left: 0;
                flex: 1;
            }

            .table-header-bar {
                align-items: stretch;
            }

            .table-header-top {
                flex-direction: column;
                align-items: stretch;
            }

            .pipeline-stat-grid {
                grid-template-columns: repeat(2, minmax(165px, 1fr));
            }

            .pipeline-stat-grid {
                grid-template-columns: repeat(2, minmax(165px, 1fr));
            }

            .processor-body {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 760px) {
            .main {
                margin-left: 0;
                flex: 1;
            }

            .table-header-bar {
                align-items: stretch;
            }

            .table-header-top {
                flex-direction: column;
                align-items: stretch;
            }

            .pipeline-stat-grid {
                grid-template-columns: repeat(2, minmax(165px, 1fr));
            }

            .processor-body {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 760px) {
            .main {
                margin-left: 0;
                flex: 1;
            }

            .table-header-bar {
                align-items: stretch;
            }

            .table-header-top {
                flex-direction: column;
                align-items: stretch;
            }

            .pipeline-stat-grid {
                grid-template-columns: repeat(2, minmax(165px, 1fr));
            }

            .table-actions {
                align-self: stretch;
            }

            .table-actions .btn {
                width: 100%;
            }

            .form-row.cols-3 {
                grid-template-columns: 1fr;
            }
            .ff-summary-grid {
                grid-template-columns: 1fr;
            }
            .ff-summary-item {
                grid-template-columns: 1fr;
                gap: 4px;
            }
            .worklist-summary-grid,
            .worklist-columns {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 620px) {
            .content {
                padding: 18px 16px 32px;
            }

            .table-header-bar {
                padding: 16px;
            }

            .table-title {
                font-size: 18px;
            }

            .processor-overlay {
                padding: 12px;
            }

            .processor-header,
            .processor-body,
            .processor-footer {
                padding-left: 16px;
                padding-right: 16px;
            }

            .processor-header {
                flex-direction: column;
                align-items: stretch;
            }

            .processor-header-actions {
                justify-content: space-between;
            }

            .processor-summary-grid {
                grid-template-columns: 1fr;
            }

            .processor-footer {
                flex-direction: column;
                align-items: stretch;
            }

            .processor-footer-danger {
                margin-left: 0;
            }

            .processor-footer-actions {
                width: 100%;
            }

            .processor-footer-actions > button,
            .processor-footer-danger > button,
            .processor-control-actions > button {
                flex: 1 1 auto;
            }

            .pipeline-stat-grid {
                grid-template-columns: 1fr;
            }

            .pipeline-stage-row {
                grid-template-columns: 1fr auto;
            }

            .pipeline-stage-bar {
                grid-column: 1 / -1;
            }

            .form-row.cols-2 {
                grid-template-columns: 1fr;
            }
        }

    

/* ---- extracted style block 2 ---- */
.toast {
    position: fixed; bottom: 28px; right: 28px; z-index: 9999;
    padding: 11px 18px; border-radius: 8px; font-size: 13px; font-weight: 500;
    font-family: 'Inter', sans-serif; color: white; box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #10b981; }
.toast-error   { background: #dc2626; }
