/* ==========================================================================
   Bibliothèque documentaire — complément à style.css
   ========================================================================== */

#libTabs .nav-link {
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.85rem;
}
#libTabs .nav-link.active {
    color: #1e293b;
    border-bottom-color: #4f46e5;
    background: transparent;
}

.lib-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

/* --- Zone de dépôt --- */

.lib-dropzone {
    background: rgba(255, 255, 255, 0.6);
    border: 2px dashed rgba(99, 102, 241, 0.35);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.lib-dropzone.is-dragover {
    background: rgba(99, 102, 241, 0.09);
    border-color: rgba(99, 102, 241, 0.75);
}

/* --- Ligne de document --- */

.doc-row {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.85rem;
    padding: 0.7rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.doc-row:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.08);
}
.doc-row.is-selected {
    border-color: #4f46e5;
    background: rgba(99, 102, 241, 0.06);
}
.doc-row.is-obsolete { opacity: 0.62; }

.doc-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}
.doc-sub { font-size: 0.72rem; color: #64748b; }

.doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.chip-rubrique { background: rgba(99, 102, 241, 0.1); color: #4338ca; border-color: rgba(99, 102, 241, 0.25); }
.chip-ready    { background: rgba(16, 185, 129, 0.12); color: #047857; border-color: rgba(16, 185, 129, 0.3); }
.chip-running  { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; border-color: rgba(59, 130, 246, 0.3); }
.chip-failed   { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border-color: rgba(239, 68, 68, 0.3); }
.chip-pending  { background: rgba(100, 116, 139, 0.12); color: #475569; border-color: rgba(100, 116, 139, 0.3); }
.chip-warn     { background: rgba(245, 158, 11, 0.14); color: #b45309; border-color: rgba(245, 158, 11, 0.32); }
.chip-private  { background: rgba(245, 158, 11, 0.14); color: #b45309; border-color: rgba(245, 158, 11, 0.32); }

/* --- File de traitement --- */

.job-row {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.75rem;
    padding: 0.6rem 0.9rem;
}
.job-steps { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.job-step {
    font-size: 0.6rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}
.job-step.is-active { background: rgba(79, 70, 229, 0.15); color: #4338ca; font-weight: 700; }
.job-step.is-done { background: rgba(16, 185, 129, 0.15); color: #047857; }

.lib-progress {
    height: 5px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.lib-progress > span {
    display: block;
    height: 100%;
    background: #4f46e5;
    transition: width 0.3s ease;
}
.lib-progress > span.is-failed { background: #dc2626; }
.lib-progress > span.is-done { background: #10b981; }

/* --- Points de connaissance --- */

.point-card {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: #fff;
}
.point-card.is-validated { border-left: 3px solid #10b981; }
.point-card.is-rejected { opacity: 0.5; border-left: 3px solid #94a3b8; }

.label-toggle {
    font-size: 0.68rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: transparent;
    color: #64748b;
    cursor: pointer;
}
.label-toggle.is-on { background: rgba(99, 102, 241, 0.14); color: #4338ca; font-weight: 700; }

/* --- Statistiques --- */

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: #1e293b; line-height: 1.1; }
.stat-label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; }

/* --- Notification --- */

.lib-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 0.65rem 1.2rem;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 0.82rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}
.lib-toast.is-error { background: #b91c1c; }

.mono { font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 0.78rem; }

@media (prefers-reduced-motion: reduce) {
    .doc-row, .lib-dropzone, .lib-progress > span { transition: none; }
}
