/**
 * S-Cloud — Group By + Sort CSS (v2.2.49)
 */

.sc-gr-wrap { position: relative; display: inline-block; }
.sc-gr-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #1f2937;
    font-size: .85rem; font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.sc-gr-toggle:hover { border-color: #7C3AED; }
.sc-gr-wrap.is-open .sc-gr-toggle { border-color: #7C3AED; background: #faf5ff; }
.sc-gr-current { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sc-gr-panel {
    position: absolute; top: calc(100% + 4px); left: 0;
    width: 220px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    z-index: 100;
    display: none;
    padding: 6px;
}
.sc-gr-wrap.is-open .sc-gr-panel { display: block; }
.sc-gr-section-title {
    padding: 6px 10px 2px;
    font-size: .65rem; text-transform: uppercase;
    color: #9ca3af; font-weight: 700; letter-spacing: .04em;
}
.sc-gr-opt, .sc-gr-sort {
    display: block;
    width: 100%;
    background: none; border: none;
    text-align: left;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: .85rem;
    color: #1f2937;
    cursor: pointer;
    transition: background .1s;
}
.sc-gr-opt:hover, .sc-gr-sort:hover { background: #f3f4f6; }
.sc-gr-opt.is-active, .sc-gr-sort.is-active {
    background: rgba(124,58,237,.1);
    color: #7C3AED;
    font-weight: 600;
}

/* ── Group headers dans l'explorateur ── */
.sc-group-header {
    grid-column: 1 / -1;
    padding: 10px 12px 4px;
    margin-top: 8px;
    border-top: 1px solid #f3f4f6;
}
.sc-group-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none;
    color: #374151;
    font-size: .85rem; font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
    transition: color .15s;
}
.sc-group-toggle:hover { color: #7C3AED; }
.sc-group-toggle svg { transition: transform .15s; }
.sc-group-header.is-collapsed .sc-group-toggle svg { transform: rotate(0); }
.sc-group-toggle svg { transform: rotate(90deg); }
.sc-group-header.is-collapsed .sc-group-toggle svg { transform: rotate(0); }

.sc-group-count {
    background: #f3f4f6;
    color: #6b7280;
    font-size: .68rem; font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
}

/* Pour le mode tiles (grid), pas de border-top */
.sp-tiles .sc-group-header { border-top: none; padding: 12px 0 4px; }
