.research-dashboard {
    --overview-panel: rgba(18, 25, 39, 0.78);
    --overview-panel-strong: rgba(24, 33, 49, 0.92);
    --overview-border: rgba(148, 163, 184, 0.2);
    --overview-muted: #a9b7c9;
    --overview-text: #f4f7fb;
    --overview-cyan: #5eead4;
    --overview-green: #86efac;
    --overview-amber: #facc15;
    --overview-violet: #c4b5fd;
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    color: var(--overview-text);
}

.research-dashboard * {
    letter-spacing: 0;
}

.research-hero,
.workflow-strip,
.research-panel,
.research-stat-card {
    border: 1px solid var(--overview-border);
    background: var(--overview-panel);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.24);
}

.research-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    padding: 30px;
    border-radius: 8px;
}

.research-eyebrow,
.panel-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--overview-cyan);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.research-hero h1 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1.18;
}

.research-hero p {
    max-width: 740px;
    margin: 0;
    color: var(--overview-muted);
    line-height: 1.65;
}

.research-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.research-action,
.workflow-step,
.panel-head a,
.panel-head select {
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.62);
    color: #e5edf8;
    text-decoration: none;
}

.research-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.research-action.primary {
    border-color: rgba(94, 234, 212, 0.45);
    background: rgba(20, 184, 166, 0.2);
    color: #ffffff;
}

.research-action:hover,
.workflow-step:hover,
.panel-head a:hover {
    border-color: rgba(94, 234, 212, 0.5);
    background: rgba(20, 184, 166, 0.14);
}

.research-action svg,
.workflow-step svg,
.panel-head svg,
.research-stat-card svg,
.feed-icon svg,
.entity-icon svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.research-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.research-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 94px;
    padding: 18px;
    border-radius: 8px;
}

.research-stat-card strong {
    display: block;
    color: #ffffff;
    font-size: 1.8rem;
    line-height: 1;
}

.research-stat-card span:last-child {
    display: block;
    margin-top: 6px;
    color: var(--overview-muted);
    font-size: 0.9rem;
}

.stat-chip,
.feed-icon,
.entity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.stat-chip.teal,
.feed-icon.teal,
.entity-icon.teal { color: var(--overview-cyan); }
.stat-chip.green,
.feed-icon.green,
.entity-icon.green { color: var(--overview-green); }
.stat-chip.amber,
.feed-icon.amber,
.entity-icon.amber { color: var(--overview-amber); }
.stat-chip.violet,
.feed-icon.violet,
.entity-icon.violet { color: var(--overview-violet); }

.workflow-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.workflow-step {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px;
}

.workflow-step span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-step strong {
    color: #ffffff;
    font-size: 1rem;
}

.research-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    grid-template-areas:
        "continue library"
        "activity analysis";
    gap: 16px;
}

.continue-panel { grid-area: continue; }
.library-panel-dashboard { grid-area: library; }
.analysis-panel { grid-area: analysis; }
.activity-panel { grid-area: activity; }

.research-panel {
    min-width: 0;
    border-radius: 8px;
    padding: 18px;
}

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

.panel-head h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1.25;
}

.panel-head a,
.panel-head select,
.panel-head > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: max-content;
    padding: 0 12px;
    color: var(--overview-muted);
    font-size: 0.88rem;
}

.panel-head select {
    height: 38px;
    cursor: pointer;
}

.workspace-stack,
.document-stack,
.analysis-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.entity-row,
.feed-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 70px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.48);
    color: inherit;
    text-decoration: none;
}

.entity-row:hover,
.feed-row:hover {
    border-color: rgba(94, 234, 212, 0.42);
    background: rgba(20, 184, 166, 0.09);
}

.entity-main,
.feed-main {
    min-width: 0;
}

.entity-main strong,
.feed-main strong {
    display: block;
    overflow: hidden;
    color: #ffffff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-main span,
.feed-main span,
.empty-panel p {
    display: block;
    margin-top: 5px;
    color: var(--overview-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.entity-meta,
.feed-status {
    color: #dbe7f5;
    font-size: 0.82rem;
    white-space: nowrap;
}

.feed-status {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    padding: 5px 9px;
    background: rgba(255, 255, 255, 0.05);
}

.feed-status.completed { color: var(--overview-green); }
.feed-status.processing { color: var(--overview-cyan); }
.feed-status.pending { color: var(--overview-amber); }
.feed-status.failed { color: #fda4af; }

.research-chart {
    height: 310px;
    min-height: 260px;
}

.empty-panel {
    display: grid;
    gap: 10px;
    justify-items: start;
    padding: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.38);
}

.empty-panel strong {
    color: #ffffff;
}

.empty-panel a,
.empty-panel button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(94, 234, 212, 0.36);
    border-radius: 8px;
    background: rgba(20, 184, 166, 0.12);
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
}

.dashboard-skeleton {
    height: 70px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.1), rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.1));
    background-size: 220% 100%;
    animation: dashboardSkeleton 1.2s ease-in-out infinite;
}

.dashboard-skeleton.short {
    height: 54px;
}

#uploadModal .upload-files-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#uploadModal [data-lucide] {
    width: 20px;
    height: 20px;
}

@keyframes dashboardSkeleton {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

@media (max-width: 1080px) {
    .research-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .research-hero-actions {
        justify-content: flex-start;
    }

    .research-stats,
    .workflow-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .research-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "continue"
            "library"
            "analysis"
            "activity";
    }
}

@media (max-width: 720px) {
    .research-dashboard {
        padding: 22px 14px 36px;
    }

    .research-hero,
    .research-panel {
        padding: 16px;
    }

    .research-hero h1 {
        font-size: 1.55rem;
    }

    .research-hero-actions,
    .research-action {
        width: 100%;
    }

    .research-stats,
    .workflow-strip {
        grid-template-columns: 1fr;
    }

    .entity-row,
    .feed-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .entity-meta,
    .feed-status {
        grid-column: 2;
        justify-self: start;
    }

    .panel-head {
        align-items: flex-start;
    }

    .panel-head select {
        max-width: 120px;
    }
}