/* ===========================================
   Mes ressources — Vue d'ensemble (compact)
   =========================================== */

/* Compteurs globaux */
.res-stats {
    display: flex;
    gap: 1rem;
    padding: 15px 20px;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.res-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1.2rem;
}

.res-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.res-stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.res-stat-detail {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.res-stat-detail svg,
.res-stat-detail i[data-lucide] {
    width: 11px;
    height: 11px;
    stroke-width: 2;
    vertical-align: middle;
}

/* Info box */
.res-info {
    padding: 10px 25px;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.res-info strong {
    color: var(--text);
    font-weight: 600;
}

.res-info a {
    color: var(--primary);
    font-weight: 600;
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

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

/* Liste de lignes */
.res-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Ligne par série */
.res-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.1s;
}

.res-row:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Cover miniature */
.res-row-cover {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.res-row-cover-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: var(--secondary, #f0f0f0);
    flex-shrink: 0;
}

/* Corps */
.res-row-body {
    flex: 1;
    min-width: 0;
}

.res-row-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.res-row-meta {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
}

.res-badge-theme {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.72rem;
}

.res-badge-niveau {
    background: #e3f2fd;
    color: #1565c0;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 500;
}

/* Compteurs à droite */
.res-row-counts {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-light);
    flex-shrink: 0;
    white-space: nowrap;
}

.res-row-counts svg,
.res-row-counts i[data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 1.75;
    color: var(--ill-orange, #E8703D);
    vertical-align: middle;
    margin-right: 2px;
}

.res-public svg,
.res-public i[data-lucide] {
    width: 11px;
    height: 11px;
    stroke-width: 2;
    color: currentColor;
    vertical-align: middle;
}

.res-sep {
    color: var(--border, #ccc);
}

.res-public {
    font-size: 0.72rem;
    color: #2e7d32;
}

/* Flèche */
.res-row-arrow {
    color: var(--text-light);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* État vide */
.res-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.res-empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    color: var(--text-light, #999);
    display: flex;
    justify-content: center;
    line-height: 1;
}

.res-empty-icon svg,
.res-empty-icon i[data-lucide] {
    width: 56px;
    height: 56px;
    stroke-width: 1.5;
}

.res-empty h3 {
    color: var(--text);
    margin-bottom: 8px;
}

.res-empty p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.res-empty a {
    color: var(--primary);
}

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 768px) {
    .res-stats {
        gap: 0.5rem;
    }

    .res-stat {
        padding: 0.4rem 0.8rem;
    }

    .res-stat-number {
        font-size: 1.2rem;
    }

    .res-row {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
    }

    .res-row-body {
        flex: 1 1 calc(100% - 70px);
    }

    .res-row-counts {
        width: 100%;
        padding-left: 62px;
        font-size: 0.75rem;
    }

    .res-row-arrow {
        display: none;
    }
}

/* ============================================
   Toolbar recherche + filtres + tri (B2 — chantier 005)
   ============================================ */
.res-toolbar {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 20px;
    margin: 15px 25px 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
}

.res-input {
    flex: 1;
    min-width: 220px;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.res-input::placeholder { color: var(--text-light); }

.res-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 112, 61, 0.15);
}

.res-select {
    padding: 0.55rem 2rem 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    font-size: 0.9rem;
    font-family: inherit;
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23E8703D' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.res-select:hover { border-color: var(--primary); }

.res-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 112, 61, 0.15);
}

.res-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 0 0.5rem;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .res-toolbar { margin: 15px 15px 0; padding: 12px 14px; }
    .res-input { min-width: 100%; }
    .res-count { margin-left: 0; width: 100%; text-align: right; padding: 0; }
}
