/* ============================================
   Agent IA Collaboratif P.F.S. - Styles
   Couleur : Violet/Purple (#7C3AED → #A855F7)
   ============================================ */

/* Vue container */
#view-agent-collaboratif {
    padding: 0;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Main container — miroir de .veille-container */
.collab-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Bannière */
.banner-agent-collab {
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 50%, #C084FC 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.banner-agent-collab::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.banner-agent-collab-left {
    flex: 1;
    min-width: 0;
}

.banner-agent-collab-left h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.banner-agent-collab-left .header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    flex-shrink: 0;
}

.banner-agent-collab-left p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.85rem;
}

.banner-agent-collab-right {
    flex-shrink: 0;
}

.banner-agent-collab h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.banner-agent-collab p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.85rem;
}

/* Nav item */
.nav-item-agent-collab {
    border-left: 3px solid transparent !important;
}
.nav-item-agent-collab:hover,
.nav-item-agent-collab.active {
    border-left-color: #7C3AED !important;
    background: rgba(124, 58, 237, 0.08) !important;
}

/* Tabs — miroir de .veille-tabs */
.agent-collab-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.5rem;
    background: var(--card-bg, white);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    flex-shrink: 0;
}

.agent-collab-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.agent-collab-tab-btn:hover {
    color: #7C3AED;
    background: rgba(124, 58, 237, 0.05);
}

.agent-collab-tab-btn.active {
    color: #7C3AED;
    border-bottom-color: #7C3AED;
    font-weight: 600;
}

.agent-collab-tab-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tab-doc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    background: #7C3AED;
    color: white;
    margin-left: 4px;
    vertical-align: middle;
}

.agent-collab-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    min-height: 0;
}
.agent-collab-tab-content.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.agent-collab-tab-content > * {
    width: 100%;
    box-sizing: border-box;
}

/* Agent Cards */
.agent-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.agent-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.agent-card:hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
    border-color: #C084FC;
}

.agent-card.selected {
    border-color: #7C3AED;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7C3AED, #A855F7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
}

.agent-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

.agent-card-domain {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.agent-card-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #f1f5f9;
}

.agent-stat {
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.agent-stat strong {
    color: #334155;
}

.agent-card-delete {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.agent-card-delete:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Agent Creation Form */
.agent-form {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.agent-form h3 {
    margin: 0 0 1.2rem 0;
    font-size: 1.1rem;
    color: #1e293b;
}

.agent-form-group {
    margin-bottom: 1rem;
}

.agent-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.agent-form-group input,
.agent-form-group select,
.agent-form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.agent-form-group input:focus,
.agent-form-group select:focus,
.agent-form-group textarea:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.agent-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.agent-form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

/* ========== CHAT CONTAINER ========== */
.chat-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #f8fafc;
}

/* ========== CHAT SIDEBAR ========== */
.chat-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    background: white;
    flex-shrink: 0;
    border-right: 1px solid #f1f5f9;
}

.chat-sidebar-header {
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #faf5ff 0%, white 100%);
    border-bottom: 1px solid #f1f5f9;
}

.chat-sidebar-header h4 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b21a8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.chat-new-session-btn {
    background: linear-gradient(135deg, #7C3AED, #9333EA);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.3);
}

.chat-new-session-btn:hover {
    background: linear-gradient(135deg, #6D28D9, #7C3AED);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.chat-sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
}

.chat-session-item {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 0.2rem;
    transition: all 0.15s;
    position: relative;
    border: 1px solid transparent;
}

.chat-session-item:hover {
    background: #faf5ff;
    border-color: #ede9fe;
}

.chat-session-item.active {
    background: linear-gradient(135deg, #ede9fe, #f5f3ff);
    border-color: #c4b5fd;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.08);
}

.chat-session-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1.2rem;
}

.chat-session-item.active .chat-session-title {
    color: #6d28d9;
}

.chat-session-date {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.chat-session-delete {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.75rem;
    display: none;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    transition: all 0.15s;
}

.chat-session-item:hover .chat-session-delete {
    display: block;
}

.chat-session-delete:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ========== CHAT MAIN AREA ========== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

/* Subtle scrollbar */
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.chat-sessions-list::-webkit-scrollbar { width: 4px; }
.chat-sessions-list::-webkit-scrollbar-track { background: transparent; }
.chat-sessions-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

/* ========== CHAT MESSAGES ========== */
.chat-msg {
    display: flex;
    gap: 0.7rem;
    max-width: 100%;
    animation: chatMsgIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 70%;
}

.chat-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-msg-avatar.user { background: linear-gradient(135deg, #475569, #64748b); border-radius: 50%; }
.chat-msg-avatar.pater { background: linear-gradient(135deg, #2563EB, #3B82F6); }
.chat-msg-avatar.filius { background: linear-gradient(135deg, #059669, #10B981); }
.chat-msg-avatar.spiritus { background: linear-gradient(135deg, #7C3AED, #A855F7); }
.chat-msg-avatar.synthesis { background: linear-gradient(135deg, #B45309, #D97706); }

.chat-msg-content {
    flex: 1;
    min-width: 0;
    background: white;
    border-radius: 14px;
    padding: 0.85rem 1.1rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.04);
}

.chat-msg.user .chat-msg-content {
    background: linear-gradient(135deg, #7C3AED, #9333EA);
    color: white;
    border: none;
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.chat-msg-content.pater {
    border-left: 3px solid #3B82F6;
    background: linear-gradient(135deg, #EFF6FF, #F8FAFF);
    border-radius: 4px 14px 14px 14px;
}

.chat-msg-content.filius {
    border-left: 3px solid #10B981;
    background: linear-gradient(135deg, #ECFDF5, #F0FFF8);
    border-radius: 4px 14px 14px 14px;
}

.chat-msg-content.spiritus {
    border-left: 3px solid #A855F7;
    background: linear-gradient(135deg, #FAF5FF, #FDF8FF);
    border-radius: 4px 14px 14px 14px;
}

.chat-msg-content.synthesis {
    border-left: 3px solid #D97706;
    background: linear-gradient(135deg, #FFFBEB, #FFF8E1);
    border-radius: 4px 14px 14px 14px;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}

.chat-msg-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.chat-msg-label.pater { color: #2563EB; }
.chat-msg-label.filius { color: #059669; }
.chat-msg-label.spiritus { color: #7C3AED; }
.chat-msg-label.synthesis { color: #B45309; }

.chat-msg-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-msg-text p { margin: 0.4rem 0; }
.chat-msg-text p:first-child { margin-top: 0; }
.chat-msg-text p:last-child { margin-bottom: 0; }
.chat-msg-text ul, .chat-msg-text ol { margin: 0.4rem 0; padding-left: 1.3rem; }
.chat-msg-text li { margin-bottom: 0.2rem; }
.chat-msg-text strong { font-weight: 600; }
.chat-msg-text code { background: rgba(0,0,0,0.06); padding: 0.1rem 0.3rem; border-radius: 4px; font-size: 0.84rem; }

/* ========== PFS BADGE ========== */
.pfs-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #B45309, #D97706);
    color: white;
    padding: 0.12rem 0.5rem;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    box-shadow: 0 1px 3px rgba(180, 83, 9, 0.3);
}

/* ========== CHAT INPUT AREA ========== */
.chat-input-area {
    padding: 0.6rem 0.75rem 0.75rem;
    background: white;
    border-top: 1px solid #f1f5f9;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.02);
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-input-row textarea {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.88rem;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    line-height: 1.5;
    font-family: inherit;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.2s;
}

.chat-input-row textarea:focus {
    outline: none;
    border-color: #a78bfa;
    background: white;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

.chat-input-row textarea::placeholder {
    color: #94a3b8;
}

.chat-send-btn {
    background: linear-gradient(135deg, #7C3AED, #9333EA);
    color: white;
    border: none;
    border-radius: 14px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, #6D28D9, #7C3AED);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.chat-send-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ========== QUICK ACTION BUTTONS ========== */
.chat-quick-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.quick-action-btn {
    background: white;
    color: #7C3AED;
    border: 1.5px solid #e9d5ff;
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #7C3AED, #9333EA);
    color: white;
    border-color: #7C3AED;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.2);
    transform: translateY(-1px);
}

/* ========== TYPING INDICATOR ========== */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: #64748b;
    background: white;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    max-width: 350px;
    animation: chatMsgIn 0.3s ease;
}

.typing-dots {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #7C3AED);
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

.chat-typing .typing-label {
    font-weight: 500;
    color: #7c3aed;
    margin-right: 0.2rem;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ========== CHAT EMPTY STATE ========== */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    text-align: center;
    padding: 2rem;
}

.chat-empty-state svg {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.chat-empty-state h3 {
    color: #64748b;
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.chat-empty-state p {
    font-size: 0.85rem;
    max-width: 360px;
    line-height: 1.5;
}

/* Harvest Cards */
.harvest-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    width: 100%;
}

.harvest-stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.harvest-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #7C3AED;
}

.harvest-stat-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.harvest-papers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    width: 100%;
}

/* --- Header bar --- */
.harvest-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.8rem;
    width: 100%;
}
.harvest-header-bar h3 {
    margin: 0;
    font-size: 1rem;
    color: #374151;
}

/* --- Selection bar --- */
.harvest-selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #FAF5FF, #F3E8FF);
    border: 1px solid #E9D5FF;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}
.harvest-selection-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.harvest-sel-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid #D8B4FE;
    background: white;
    border-radius: 6px;
    font-size: 0.78rem;
    color: #7C3AED;
    cursor: pointer;
    transition: all 0.15s;
}
.harvest-sel-btn:hover {
    background: #F3E8FF;
}
.btn-agent-collab.save {
    background: linear-gradient(135deg, #059669, #10B981);
    border: none;
    color: white;
    font-weight: 600;
}
.btn-agent-collab.save:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857, #059669);
}
.btn-agent-collab.save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Legend --- */
.harvest-legend {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    color: #64748b;
}
.harvest-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.harvest-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}
.harvest-legend-dot.saved { background: #10B981; }
.harvest-legend-dot.new { background: #7C3AED; }

/* --- Paper card base --- */
.harvest-paper-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}
.harvest-paper-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

/* Saved state — green */
.harvest-paper-card.saved {
    border-left-color: #10B981;
    background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
}
.harvest-paper-card.saved:hover {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

/* New state — purple */
.harvest-paper-card.new {
    border-left-color: #7C3AED;
    background: linear-gradient(135deg, #FAF5FF 0%, #F5F3FF 100%);
}
.harvest-paper-card.new:hover {
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

/* Selected overlay */
.harvest-paper-card.selected {
    border-color: #7C3AED;
    border-left-width: 4px;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}
.harvest-paper-card.saved.selected {
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

/* --- Checkbox --- */
.harvest-paper-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.harvest-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #CBD5E1;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    background: white;
}
.harvest-checkbox.checked {
    background: #7C3AED;
    border-color: #7C3AED;
}
.harvest-paper-card.saved .harvest-checkbox.checked {
    background: #10B981;
    border-color: #10B981;
}

/* --- Badge --- */
.harvest-paper-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.harvest-paper-badge.saved {
    background: #D1FAE5;
    color: #059669;
}
.harvest-paper-badge.new {
    background: #F3E8FF;
    color: #7C3AED;
}

/* --- Resume --- */
.harvest-paper-resume {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
    line-height: 1.4;
    max-height: 4rem;
    overflow: hidden;
}

/* --- Stat cards states --- */
.harvest-stat-card.saved .harvest-stat-value { color: #10B981; }
.harvest-stat-card.new .harvest-stat-value { color: #7C3AED; }

.harvest-paper-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.harvest-paper-authors {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.harvest-paper-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.source-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.source-badge.semantic_scholar { background: #DBEAFE; color: #1D4ED8; }
.source-badge.arxiv { background: #FEE2E2; color: #DC2626; }
.source-badge.crossref { background: #D1FAE5; color: #059669; }

.harvest-paper-year {
    font-size: 0.78rem;
    color: #64748b;
}

.harvest-paper-score {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #F3E8FF;
    color: #7C3AED;
}

/* Translated badge */
.chat-translated-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.62rem;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
    margin-left: 6px;
    cursor: help;
    vertical-align: middle;
}
[data-theme="dark"] .chat-translated-badge {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
}

/* Harvest Filters */
.harvest-filters {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.harvest-filters select,
.harvest-filters input {
    padding: 0.45rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Buttons */
.btn-agent-collab {
    background: #7C3AED;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-agent-collab:hover {
    background: #6D28D9;
}

.btn-agent-collab:disabled {
    background: #C4B5FD;
    cursor: not-allowed;
}

.btn-agent-collab.secondary {
    background: #EDE9FE;
    color: #7C3AED;
}

.btn-agent-collab.secondary:hover {
    background: #DDD6FE;
}

/* Loading overlay */
.agent-collab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}

.agent-collab-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E9D5FF;
    border-top-color: #7C3AED;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* Toast */
.agent-collab-toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    color: white;
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 10000;
    animation: toastSlide 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.agent-collab-toast.success { background: #059669; }
.agent-collab-toast.error { background: #DC2626; }
.agent-collab-toast.info { background: #7C3AED; }

@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* PFS Agents Info Panel — inside banner */
.pfs-agents-panel {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pfs-agent-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.pfs-agent-info.pater { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.25); }
.pfs-agent-info.filius { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.25); }
.pfs-agent-info.spiritus { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.25); }

/* ========== CONTEXT / COLLECTE DE DONNEES TAB ========== */
.context-tab-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.context-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
}

.context-section-header h3 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.context-section-header h3 svg { color: #7C3AED; }

.context-hint {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0 0 0.8rem 0;
}

/* Quill editor */
#collab-context-editor { min-height: 200px; }
#collab-context-editor .ql-editor { min-height: 180px; font-size: 0.9rem; }
.context-section .ql-toolbar { border-radius: 8px 8px 0 0; border-color: #e2e8f0; }
.context-section .ql-container { border-radius: 0 0 8px 8px; border-color: #e2e8f0; }

/* Dropzone */
.context-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    text-align: center;
    margin-bottom: 1rem;
}

.context-dropzone:hover { border-color: #A855F7; background: #faf5ff; }
.context-dropzone.dragover { border-color: #7C3AED; background: #f3e8ff; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); }
.context-dropzone svg { color: #94a3b8; margin-bottom: 0.75rem; }
.context-dropzone p { margin: 0 0 0.3rem 0; font-size: 0.9rem; color: #475569; font-weight: 500; }
.context-dropzone-hint { font-size: 0.78rem; color: #94a3b8; }

/* Documents list */
.context-docs-list { display: flex; flex-direction: column; gap: 0.5rem; }
.context-docs-empty { text-align: center; padding: 1.5rem; color: #94a3b8; font-size: 0.85rem; }
.context-docs-empty svg { margin-bottom: 0.5rem; }

.context-doc-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.15s;
}

.context-doc-item:hover { background: #faf5ff; border-color: #e9d5ff; }

.context-doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.context-doc-info { flex: 1; min-width: 0; }
.context-doc-name { font-size: 0.88rem; font-weight: 500; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context-doc-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 0.1rem; }

.context-doc-delete {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.context-doc-delete:hover { color: #ef4444; background: #fef2f2; }

/* Save actions bar */
.context-actions { display: flex; align-items: center; gap: 1rem; }
.context-save-status { font-size: 0.82rem; color: #059669; font-weight: 500; }

/* ========== CONTEXT DARK MODE ========== */
[data-theme="dark"] .context-section { background: var(--card-bg); border-color: var(--border-color); }
[data-theme="dark"] .context-section-header h3 { color: var(--text-primary); }
[data-theme="dark"] .context-hint { color: var(--text-secondary); }
[data-theme="dark"] .context-dropzone { background: var(--bg-tertiary, #1A2744); border-color: var(--border-color); }
[data-theme="dark"] .context-dropzone:hover { border-color: rgba(124, 58, 237, 0.5); background: rgba(124, 58, 237, 0.05); }
[data-theme="dark"] .context-dropzone p { color: var(--text-primary); }
[data-theme="dark"] .context-doc-item { border-color: var(--border-color); }
[data-theme="dark"] .context-doc-item:hover { background: rgba(124, 58, 237, 0.08); }
[data-theme="dark"] .context-doc-icon { background: var(--bg-tertiary, #1A2744); }
[data-theme="dark"] .context-doc-name { color: var(--text-primary); }
[data-theme="dark"] .context-section .ql-toolbar { border-color: var(--border-color); background: var(--bg-tertiary, #1A2744); }
[data-theme="dark"] .context-section .ql-container { border-color: var(--border-color); background: var(--input-bg, #1A2744); color: var(--text-primary); }
[data-theme="dark"] .context-section .ql-editor.ql-blank::before { color: var(--text-secondary); }

/* ========== CONTEXT HARVEST DATA ========== */
.context-harvest-list { display: flex; flex-direction: column; gap: 0.4rem; }
.context-harvest-count {
    font-size: 0.85rem; font-weight: 600; color: #10B981;
    padding: 0.5rem 0.75rem; margin-bottom: 0.3rem;
    background: rgba(16, 185, 129, 0.08); border-radius: 8px;
}
.context-harvest-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0.75rem; border-radius: 8px;
    border: 1px solid #e5e7eb; background: #fafafa;
    transition: all 0.15s ease;
}
.context-harvest-item:hover { background: #f0fdf4; border-color: #bbf7d0; }
.context-harvest-info { flex: 1; min-width: 0; }
.context-harvest-title { font-size: 0.82rem; font-weight: 500; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context-harvest-meta { font-size: 0.75rem; color: #6b7280; margin-top: 2px; }
.context-harvest-badge {
    flex-shrink: 0; width: 24px; height: 24px;
    border-radius: 50%; background: #10B981; color: white;
    display: flex; align-items: center; justify-content: center;
    margin-left: 0.5rem;
}

[data-theme="dark"] .context-harvest-count { background: rgba(16, 185, 129, 0.15); color: #34d399; }
[data-theme="dark"] .context-harvest-item { border-color: var(--border-color); background: var(--bg-secondary, #1e293b); }
[data-theme="dark"] .context-harvest-item:hover { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.3); }
[data-theme="dark"] .context-harvest-title { color: var(--text-primary); }
[data-theme="dark"] .context-harvest-meta { color: var(--text-secondary); }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .collab-container { overflow-y: auto; }

    .banner-agent-collab {
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
    }

    .banner-agent-collab-right {
        width: 100%;
    }

    .pfs-agents-panel {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .agent-collab-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 0.75rem;
    }

    .agent-collab-tab-btn {
        flex-shrink: 0;
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
    }

    .chat-container {
        flex-direction: column;
    }

    .chat-sidebar {
        width: 100%;
        max-height: 180px;
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
    }

    .chat-messages {
        padding: 0.75rem 0.5rem;
    }

    .chat-msg, .chat-msg.user {
        max-width: 100%;
    }

    .chat-input-area {
        padding: 0.6rem 0.5rem 0.5rem;
    }

    .agent-cards-grid {
        grid-template-columns: 1fr;
    }

    .harvest-papers-grid {
        grid-template-columns: 1fr;
    }

    .chat-quick-actions {
        gap: 0.25rem;
    }

    .quick-action-btn {
        font-size: 0.72rem;
        padding: 0.25rem 0.6rem;
    }

    .context-dropzone {
        padding: 1.5rem 1rem;
    }
}

/* ============================================================
   DARK MODE OVERRIDES
   ============================================================ */

[data-theme="dark"] .agent-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .agent-card:hover {
    border-color: var(--border-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-theme="dark"] .agent-card h4,
[data-theme="dark"] .agent-form h4,
[data-theme="dark"] .agent-section-title {
    color: var(--text-primary);
}

[data-theme="dark"] .agent-card p,
[data-theme="dark"] .agent-card .agent-keywords {
    color: var(--text-secondary);
}

[data-theme="dark"] .agent-form {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .agent-form input,
[data-theme="dark"] .agent-form textarea,
[data-theme="dark"] .agent-form select {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-container {
    background: var(--bg-primary);
}

[data-theme="dark"] .chat-sidebar {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .chat-sidebar-header {
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--card-bg) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .chat-sidebar-header h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .chat-session-item {
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-session-item:hover {
    background: rgba(124, 58, 237, 0.12);
}

[data-theme="dark"] .chat-session-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.08));
    border-color: rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .chat-session-item .session-name {
    color: var(--text-primary);
}

[data-theme="dark"] .chat-session-item .session-date {
    color: var(--text-muted);
}

[data-theme="dark"] .chat-main {
    background: var(--bg-primary);
}

[data-theme="dark"] .chat-messages {
    background: var(--bg-primary);
}

[data-theme="dark"] .chat-msg-content {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-msg-content.pater {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .chat-msg-content.filius {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .chat-msg-content.spiritus {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
    border-color: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .chat-msg-content.synthesis {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .chat-msg-name {
    color: var(--text-primary);
}

[data-theme="dark"] .chat-msg-text {
    color: var(--text-primary);
}

[data-theme="dark"] .chat-msg-text code {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-input-area {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .chat-input-row textarea {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-input-row textarea:focus {
    background: var(--bg-tertiary);
    border-color: var(--input-focus);
}

[data-theme="dark"] .quick-action-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .quick-action-btn:hover {
    background: var(--bg-elevated);
    border-color: rgba(124, 58, 237, 0.3);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-typing {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Harvest tab dark mode */
[data-theme="dark"] .harvest-stat-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .harvest-stat-card .stat-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .harvest-stat-card .stat-value {
    color: var(--text-primary);
}

[data-theme="dark"] .harvest-selection-bar {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.06));
    border-color: rgba(124, 58, 237, 0.2);
}

[data-theme="dark"] .harvest-sel-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .harvest-sel-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

[data-theme="dark"] .harvest-paper-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .harvest-paper-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-theme="dark"] .harvest-paper-card.saved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
    border-left-color: #10B981;
}

[data-theme="dark"] .harvest-paper-card.new {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0.04) 100%);
    border-left-color: #7C3AED;
}

[data-theme="dark"] .harvest-paper-card .paper-title {
    color: var(--text-primary);
}

[data-theme="dark"] .harvest-paper-card .paper-authors,
[data-theme="dark"] .harvest-paper-card .paper-source,
[data-theme="dark"] .harvest-paper-card .paper-date {
    color: var(--text-secondary);
}

[data-theme="dark"] .harvest-checkbox {
    background: var(--input-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .harvest-paper-badge.saved {
    background: rgba(16, 185, 129, 0.15);
    color: #4ADE80;
}

[data-theme="dark"] .harvest-paper-badge.new {
    background: rgba(124, 58, 237, 0.15);
    color: #C4B5FD;
}

[data-theme="dark"] .harvest-legend {
    color: var(--text-secondary);
}

/* Agent tab dark mode */
[data-theme="dark"] .agent-collab-tab-content {
    background: var(--bg-primary);
}

[data-theme="dark"] .no-agent-placeholder,
[data-theme="dark"] .harvest-empty {
    color: var(--text-secondary);
}

[data-theme="dark"] .no-agent-placeholder h3 {
    color: var(--text-primary);
}

/* ============================================
   Auto-Harvest & Enrichissement — Styles
   ============================================ */

/* Improvement Level Badge */
.agent-level-badge {
    position: relative;
    width: 40px;
    height: 40px;
    margin-left: auto;
    cursor: pointer;
    flex-shrink: 0;
}
.agent-level-badge svg {
    display: block;
}
.level-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Schedule Panel */
.agent-schedule-panel {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0f9ff 100%);
    border: 1px solid #d1fae5;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.25rem;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.08);
}

/* Header */
.schedule-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}
.schedule-panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.schedule-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10B981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.schedule-panel-title h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 0.15rem 0;
}
.schedule-subtitle {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
}

/* Toggle switch */
.schedule-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.schedule-switch input { opacity: 0; width: 0; height: 0; }
.schedule-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 26px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.schedule-switch-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.schedule-switch input:checked + .schedule-switch-slider {
    background: linear-gradient(135deg, #10B981, #059669);
}
.schedule-switch input:checked + .schedule-switch-slider::before {
    transform: translateX(22px);
}

/* Config area */
.schedule-config {
    transition: opacity 0.3s, max-height 0.3s;
}

/* Sections grid */
.schedule-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.schedule-section {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 12px;
    padding: 0.85rem;
}
.schedule-section-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #065f46;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.6rem;
}
.schedule-section-label svg {
    color: #10B981;
    flex-shrink: 0;
}

/* Frequency row */
.schedule-freq-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.schedule-select {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
    background: white;
    color: #1f2937;
    cursor: pointer;
    transition: border-color 0.2s;
}
.schedule-select:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.schedule-times-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.schedule-times-input {
    width: 48px;
    padding: 0.45rem 0.4rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    background: white;
    color: #1f2937;
}
.schedule-times-input:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.schedule-times-label {
    font-size: 0.78rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Source chips */
.schedule-source-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.source-chip {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid #e5e7eb;
    background: white;
    color: #374151;
    transition: all 0.2s;
    user-select: none;
}
.source-chip input { display: none; }
.source-chip-icon {
    font-weight: 800;
    font-size: 0.72rem;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.source-chip.semantic_scholar .source-chip-icon { background: #F59E0B; }
.source-chip.arxiv .source-chip-icon { background: #B91C1C; }
.source-chip.crossref .source-chip-icon { background: #2563EB; }
.source-chip.orcid .source-chip-icon { background: #A6CE39; color: #1f2937; }
.source-chip:has(input:checked) {
    border-color: #10B981;
    background: #ecfdf5;
    color: #065f46;
}
.source-chip:hover {
    border-color: #a7f3d0;
    background: #f0fdf4;
}

/* Deep Hemisync+ row */
.schedule-dh-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 12px;
    margin-bottom: 1rem;
}
.schedule-dh-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
}
.schedule-dh-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #7C3AED;
}
.schedule-dh-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #5B21B6;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
}
.schedule-dh-badge svg {
    color: #7C3AED;
}
.dh-pfs-tag {
    font-size: 0.68rem;
    font-weight: 800;
    background: linear-gradient(135deg, #7C3AED, #A855F7);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.schedule-dh-hint {
    font-size: 0.78rem;
    color: #7c3aed;
    font-style: italic;
}

/* Threshold section */
.schedule-threshold-section {
    margin-bottom: 1rem;
}
.schedule-threshold-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.schedule-threshold-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #059669;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    padding: 0.15rem 0.6rem;
    border-radius: 8px;
}
.schedule-threshold-slider-wrap {
    position: relative;
}
.schedule-threshold-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #fca5a5 0%, #fde68a 40%, #86efac 80%, #34d399 100%);
    outline: none;
    cursor: pointer;
}
.schedule-threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #10B981;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.15s;
}
.schedule-threshold-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.schedule-threshold-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #10B981;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
}
.schedule-threshold-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.3rem;
}

/* Save button */
.schedule-save-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.schedule-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.schedule-save-btn:active {
    transform: translateY(0);
}
.schedule-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(16, 185, 129, 0.1);
}
.schedule-status-text {
    font-size: 0.82rem;
    color: #059669;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .schedule-sections-grid {
        grid-template-columns: 1fr;
    }
    .schedule-panel-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Harvest Approval Banner */
.harvest-approval-banner {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border: 1px solid #F59E0B;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.approval-banner-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #92400e;
}

/* Approval Modal */
.harvest-approval-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.harvest-approval-modal.open {
    display: flex;
}
.approval-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.approval-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    z-index: 1;
}
.approval-modal-header h3 {
    font-size: 1rem;
    margin: 0;
    color: #1f2937;
}
.approval-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
}
.approval-items-list {
    padding: 0.5rem 1rem;
}
.approval-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s;
}
.approval-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.approval-item-scores {
    display: flex;
    gap: 0.4rem;
}
.score-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
}
.score-badge.relevance {
    background: #dbeafe;
    color: #1d4ed8;
}
.score-badge.credibility {
    background: #d1fae5;
    color: #065f46;
}
.approval-item-actions {
    display: flex;
    gap: 0.3rem;
}
.btn-approve, .btn-reject {
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.btn-approve { background: #d1fae5; color: #065f46; }
.btn-approve:hover { background: #10B981; color: white; transform: scale(1.1); }
.btn-reject { background: #fee2e2; color: #991b1b; }
.btn-reject:hover { background: #ef4444; color: white; transform: scale(1.1); }
.approval-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
    margin-bottom: 0.2rem;
}
.approval-item-authors {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 0.3rem;
}
.approval-item-resume {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.4;
}

/* Research Orientations Panel */
.research-orientations-panel {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}
.orientations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.orientations-header h4 {
    font-size: 1rem;
    margin: 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-small-collab {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-small-collab:hover { opacity: 0.9; }
.orientation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}
.orientation-card {
    border-radius: 12px;
    padding: 1rem;
    border-left: 4px solid;
    background: #f9fafb;
}
.orientation-card.direction {
    border-left-color: #3B82F6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}
.orientation-card.innovation {
    border-left-color: #10B981;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}
.orientation-card.key_element {
    border-left-color: #F59E0B;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}
.orientation-type {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.orientation-card h5 {
    font-size: 0.92rem;
    margin: 0.4rem 0;
    color: #1f2937;
    line-height: 1.3;
}
.orientation-card p {
    font-size: 0.82rem;
    color: #4b5563;
    line-height: 1.4;
    margin: 0;
}
.orientation-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #6b7280;
}
.orientation-priority {
    font-weight: 600;
}

/* Harvest History */
.harvest-history {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}
.harvest-history h4 {
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.harvest-log-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.85rem;
}
.log-date {
    color: #6b7280;
    min-width: 120px;
}
.log-type {
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}
.log-type.manual { background: #e0e7ff; color: #3730a3; }
.log-type.auto { background: #d1fae5; color: #065f46; }
.log-type.dh_plus { background: #ede9fe; color: #5b21b6; }
.log-stats {
    color: #374151;
    flex: 1;
}
.log-duration {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* Level Detail Modal Metrics */
.level-metric-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.level-metric-label {
    font-size: 0.85rem;
    color: #374151;
    min-width: 160px;
}
.level-metric-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}
.level-metric-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.level-metric-value {
    font-size: 0.8rem;
    color: #6b7280;
    min-width: 70px;
    text-align: right;
}

/* Dark mode */
[data-theme="dark"] .agent-schedule-panel {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #0c4a6e 100%);
    border-color: #047857;
}
[data-theme="dark"] .schedule-panel-header { border-bottom-color: rgba(16, 185, 129, 0.25); }
[data-theme="dark"] .schedule-panel-title h3 { color: #d1fae5; }
[data-theme="dark"] .schedule-subtitle { color: #9ca3af; }
[data-theme="dark"] .schedule-section {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(16, 185, 129, 0.2);
}
[data-theme="dark"] .schedule-section-label { color: #a7f3d0; }
[data-theme="dark"] .schedule-select,
[data-theme="dark"] .schedule-times-input {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}
[data-theme="dark"] .source-chip {
    background: #1f2937;
    border-color: #374151;
    color: #d1d5db;
}
[data-theme="dark"] .source-chip:has(input:checked) {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10B981;
    color: #a7f3d0;
}
[data-theme="dark"] .schedule-dh-row {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(168, 85, 247, 0.15));
    border-color: rgba(124, 58, 237, 0.25);
}
[data-theme="dark"] .schedule-dh-badge {
    background: rgba(124, 58, 237, 0.25);
    color: #c4b5fd;
}
[data-theme="dark"] .schedule-dh-hint { color: #c4b5fd; }
[data-theme="dark"] .schedule-threshold-value {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}
[data-theme="dark"] .schedule-threshold-labels { color: #6b7280; }
[data-theme="dark"] .schedule-actions { border-top-color: rgba(16, 185, 129, 0.15); }
[data-theme="dark"] .schedule-status-text { color: #34d399; }
[data-theme="dark"] .harvest-approval-banner {
    background: linear-gradient(135deg, #78350f, #92400e);
    border-color: #b45309;
}
[data-theme="dark"] .approval-banner-left { color: #fde68a; }
[data-theme="dark"] .approval-modal-content { background: #1f2937; }
[data-theme="dark"] .approval-modal-header { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .approval-modal-header h3 { color: #f9fafb; }
[data-theme="dark"] .approval-item { border-color: #374151; }
[data-theme="dark"] .approval-item-title { color: #f9fafb; }
[data-theme="dark"] .orientation-card { background: #111827; }
[data-theme="dark"] .orientation-card.direction { background: linear-gradient(135deg, #1e3a5f, #1e40af); }
[data-theme="dark"] .orientation-card.innovation { background: linear-gradient(135deg, #064e3b, #065f46); }
[data-theme="dark"] .orientation-card.key_element { background: linear-gradient(135deg, #78350f, #92400e); }
[data-theme="dark"] .orientation-card h5 { color: #f9fafb; }
[data-theme="dark"] .orientation-card p { color: #d1d5db; }
[data-theme="dark"] .harvest-history h4 { color: #f9fafb; }
[data-theme="dark"] .harvest-log-entry { border-color: #374151; }
[data-theme="dark"] .level-metric-label { color: #d1d5db; }
[data-theme="dark"] .level-metric-bar { background: #374151; }
[data-theme="dark"] .research-orientations-panel,
[data-theme="dark"] .harvest-history { border-top-color: #374151; }

/* ============================================
   Knowledge Progression Panel
   ============================================ */

.knowledge-progression-panel {
    margin: 1.25rem 0;
    border: 1px solid #E9D5FF;
    border-radius: 16px;
    background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 50%, #EDE9FE 100%);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.08);
}
.kp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.kp-header:hover { background: rgba(124, 58, 237, 0.04); }
.kp-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #6D28D9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.kp-toggle-icon {
    transition: transform 0.3s ease;
    color: #7C3AED;
    flex-shrink: 0;
}
.kp-toggle-icon.collapsed { transform: rotate(-90deg); }

.kp-body {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.kp-body.hidden { display: none; }

/* Section 1: Level + Summary */
.kp-top-row {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}

/* Circular Level Gauge */
.kp-level-ring {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15);
}
.kp-level-ring-inner {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
}
.kp-level-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: #7C3AED;
    line-height: 1;
}
.kp-level-name {
    font-size: 0.68rem;
    color: #6D28D9;
    font-weight: 600;
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.kp-level-score {
    font-size: 0.6rem;
    color: #A78BFA;
    margin-top: 0.1rem;
}

/* Summary Mini Cards */
.kp-summary-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    flex: 1;
}
.kp-mini-card {
    background: white;
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
    text-align: center;
    border: 1px solid #E9D5FF;
    transition: transform 0.2s, box-shadow 0.2s;
}
.kp-mini-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.1);
}
.kp-mini-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #7C3AED;
    line-height: 1.1;
}
.kp-mini-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.2rem;
    font-weight: 500;
}

/* Section 3: 5 Metric Bars */
.kp-metrics-section h5 {
    margin: 0 0 0.6rem 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6D28D9;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.kp-metric-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}
.kp-metric-label {
    font-size: 0.75rem;
    color: #4b5563;
    min-width: 130px;
    flex-shrink: 0;
}
.kp-metric-bar {
    flex: 1;
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}
.kp-metric-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}
.kp-metric-value {
    font-size: 0.72rem;
    color: #64748b;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

/* Section 4: Growth Timeline */
.kp-timeline-section h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6D28D9;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.kp-timeline-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 90px;
    padding: 0;
    border-bottom: 2px solid #D8B4FE;
    position: relative;
}
.kp-timeline-bar-group {
    flex: 1;
    min-width: 16px;
    max-width: 48px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}
.kp-timeline-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #C4B5FD, #DDD6FE);
    position: relative;
    transition: height 0.5s ease;
    min-height: 2px;
}
.kp-timeline-bar-validated {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #7C3AED, #6D28D9);
    border-radius: 0;
    transition: height 0.5s ease;
}
.kp-timeline-labels {
    display: flex;
    gap: 3px;
    margin-top: 0.3rem;
}
.kp-timeline-label {
    flex: 1;
    min-width: 16px;
    max-width: 48px;
    font-size: 0.6rem;
    color: #6D28D9;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kp-timeline-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.4rem;
    justify-content: center;
}
.kp-timeline-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    color: #64748b;
}
.kp-timeline-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
.kp-timeline-legend-dot.total { background: linear-gradient(180deg, #C4B5FD, #DDD6FE); }
.kp-timeline-legend-dot.validated { background: linear-gradient(180deg, #7C3AED, #6D28D9); }

/* Section 5: Sources + Efficiency */
.kp-bottom-row {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.kp-sources-section, .kp-efficiency-section {
    flex: 1;
    min-width: 200px;
}
.kp-sources-section h5, .kp-efficiency-section h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6D28D9;
}
.kp-sources-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.kp-source-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    border: 1px solid #E9D5FF;
    color: #4b5563;
}
.kp-source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.kp-source-dot.semantic_scholar { background: #3B82F6; }
.kp-source-dot.arxiv { background: #EF4444; }
.kp-source-dot.crossref { background: #F59E0B; }
.kp-source-dot.orcid { background: #10B981; }

.kp-efficiency-stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.kp-eff-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #4b5563;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f3e8ff;
}
.kp-eff-stat:last-child { border-bottom: none; }
.kp-eff-value {
    font-weight: 700;
    color: #7C3AED;
}

/* No data state */
.kp-no-data {
    text-align: center;
    padding: 1.5rem;
    color: #64748b;
    font-size: 0.85rem;
}
.kp-no-data svg {
    display: block;
    margin: 0 auto 0.5rem;
    opacity: 0.4;
}

/* Responsive */
@media (max-width: 640px) {
    .kp-top-row { flex-direction: column; align-items: center; }
    .kp-level-ring { width: 90px; height: 90px; }
    .kp-level-ring-inner { width: 66px; height: 66px; }
    .kp-summary-row { grid-template-columns: repeat(2, 1fr); width: 100%; }
    .kp-metric-label { min-width: 100px; font-size: 0.7rem; }
    .kp-bottom-row { flex-direction: column; }
}

/* Dark Mode */
[data-theme="dark"] .knowledge-progression-panel {
    background: linear-gradient(135deg, #1e1033 0%, #2d1b69 50%, #1a1145 100%);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.15);
}
[data-theme="dark"] .kp-header:hover { background: rgba(124, 58, 237, 0.1); }
[data-theme="dark"] .kp-header h4 { color: #C4B5FD; }
[data-theme="dark"] .kp-toggle-icon { color: #A78BFA; }
[data-theme="dark"] .kp-level-ring { box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3); }
[data-theme="dark"] .kp-level-ring-inner { background: #1f2937; box-shadow: inset 0 1px 4px rgba(0,0,0,0.3); }
[data-theme="dark"] .kp-level-number { color: #C4B5FD; }
[data-theme="dark"] .kp-level-name { color: #A78BFA; }
[data-theme="dark"] .kp-level-score { color: #7C3AED; }
[data-theme="dark"] .kp-mini-card { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .kp-mini-card:hover { box-shadow: 0 3px 10px rgba(124, 58, 237, 0.2); }
[data-theme="dark"] .kp-mini-value { color: #C4B5FD; }
[data-theme="dark"] .kp-mini-label { color: #9ca3af; }
[data-theme="dark"] .kp-metrics-section h5,
[data-theme="dark"] .kp-timeline-section h5,
[data-theme="dark"] .kp-sources-section h5,
[data-theme="dark"] .kp-efficiency-section h5 { color: #C4B5FD; }
[data-theme="dark"] .kp-metric-label { color: #d1d5db; }
[data-theme="dark"] .kp-metric-bar { background: #374151; }
[data-theme="dark"] .kp-metric-value { color: #9ca3af; }
[data-theme="dark"] .kp-timeline-chart { border-bottom-color: #4c1d95; }
[data-theme="dark"] .kp-timeline-bar { background: linear-gradient(180deg, #6D28D9, #4c1d95); }
[data-theme="dark"] .kp-timeline-bar-validated { background: linear-gradient(180deg, #A855F7, #7C3AED); }
[data-theme="dark"] .kp-timeline-label { color: #A78BFA; }
[data-theme="dark"] .kp-timeline-legend-item { color: #9ca3af; }
[data-theme="dark"] .kp-source-chip { background: #1f2937; border-color: #374151; color: #d1d5db; }
[data-theme="dark"] .kp-eff-stat { color: #d1d5db; border-bottom-color: rgba(124, 58, 237, 0.15); }
[data-theme="dark"] .kp-eff-value { color: #C4B5FD; }
[data-theme="dark"] .kp-no-data { color: #9ca3af; }
