*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: var(--fs-md);
    line-height: 1.6;
}

/* L'attribut [hidden] doit toujours l'emporter sur un display de classe (modale, etc.). */
[hidden] { display: none !important; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
}
.brand { font-weight: 600; font-size: var(--fs-lg); }
.badge {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px var(--space-3);
}

.main { max-width: 1080px; margin: 0 auto; padding: var(--space-6) var(--space-4); }
.login__form { max-width: 420px; }

.hero__title { font-size: var(--fs-xl); margin: 0 0 var(--space-2); }
.hero__sub { color: var(--text-muted); margin: 0 0 var(--space-6); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    margin-bottom: var(--space-4);
}
.card--ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.card__head { font-weight: 600; margin: 0 0 var(--space-2); }
.card__line { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--ok); }

.stack, .next { margin: 0; padding-left: var(--space-6); color: var(--text-muted); }
.stack li, .next li { margin: var(--space-1) 0; }
.stack strong { color: var(--text); }

code {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 1px 6px;
    font-size: var(--fs-sm);
}

/* ---------- Sélecteur de couleur ---------- */
.cp { position: relative; display: inline-block; }
.cp__trigger {
    display: flex; align-items: center; gap: var(--space-2);
    min-width: 220px; padding: 8px 10px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.cp__sw {
    width: 18px; height: 18px; border-radius: 50%;
    border: 1px solid var(--border); flex-shrink: 0;
}
.cp__label { flex: 1; text-align: left; }
.cp__chevron { color: var(--text-muted); }

.cp__panel {
    position: absolute; z-index: 30; margin-top: 4px; width: 300px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--space-2);
}
.cp__search {
    width: 100%; box-sizing: border-box; padding: 8px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: var(--space-2);
}
.cp__filterrow { display: flex; align-items: flex-start; gap: 6px; margin-bottom: var(--space-2); }
.cp__filterlabel {
    flex-shrink: 0; width: 48px; padding-top: 4px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
}
.cp__chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cp__chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; padding: 3px 8px; border-radius: 999px;
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border); cursor: pointer;
}
.cp__chip.is-active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.cp__huedot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--border); }

.cp__list { max-height: 280px; overflow: auto; }
.cp__row {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 6px 8px; border: 0; border-radius: var(--radius);
    background: transparent; color: var(--text); cursor: pointer; text-align: left;
}
.cp__row:hover, .cp__row.is-active { background: var(--surface-2); }
.cp__rowname { flex: 1; font-size: var(--fs-sm); }
.cp__rowid { font-size: 12px; color: var(--text-muted); font-family: monospace; }
.cp__divider {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted); padding: 8px 8px 4px;
}
.cp__empty { padding: 12px; color: var(--text-muted); font-size: var(--fs-sm); }
.cp__extra:empty { display: none; }
.cp__allbtn {
    display: block; width: 100%; margin: var(--space-2) 0; padding: 7px 10px;
    background: transparent; color: var(--text-muted);
    border: 1px dashed var(--border); border-radius: var(--radius);
    font-size: 12px; cursor: pointer; text-align: center;
}
.cp__allbtn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Recherche de pièces ---------- */
.ps__bar { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.ps__input {
    flex: 1; box-sizing: border-box; padding: 10px 12px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: var(--fs-md);
}
.ps__sort {
    flex-shrink: 0; padding: 0 8px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: var(--fs-sm);
}
.ps__hint { color: var(--text-muted); font-size: var(--fs-sm); margin: var(--space-2) 0; }
.ps__list { list-style: none; margin: 0; padding: 0; }
.ps__row { display: flex; align-items: center; gap: var(--space-3); padding: 8px 6px; border-bottom: 1px solid var(--border); }
.ps__thumb {
    width: 40px; height: 40px; flex-shrink: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius);
    background: var(--surface-2) center/22px no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='1.5'%3E%3Crect x='4' y='7' width='16' height='12' rx='1.5'/%3E%3Ccircle cx='9' cy='5.5' r='1.3'/%3E%3Ccircle cx='15' cy='5.5' r='1.3'/%3E%3C/svg%3E");
}
.ps__thumb img { width: 40px; height: 40px; object-fit: contain; background: var(--surface-2); }
.ps__main { display: flex; flex-direction: column; min-width: 0; }
.ps__name { font-size: var(--fs-sm); }
.ps__meta { font-size: 12px; color: var(--text-muted); font-family: monospace; }

/* ---------- Navigation ---------- */
.brand { text-decoration: none; color: var(--text); }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.topnav a { color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm); padding: 4px 2px; }
.topnav a:hover { color: var(--text); }
.topnav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.topnav__logout { margin-left: auto; }

/* ---------- Flashes ---------- */
.flash {
    padding: 10px 14px; margin-bottom: var(--space-3);
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.flash--success { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.flash--error { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.flash--undo { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* ---------- Pages génériques ---------- */
.page__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.page__title { margin: 0; }
.page__hint { color: var(--text-muted); font-size: var(--fs-sm); margin: 0 0 var(--space-3); }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-block; padding: 7px 12px; font-size: var(--fs-sm); cursor: pointer;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn--danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* ---------- Collections ---------- */
.col-create { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.col-create input {
    padding: 8px 10px; background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.col-create__name { flex: 1; min-width: 160px; }
.col-create__desc { flex: 1; min-width: 160px; }

.col-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.col-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.col-row__name { font-weight: 500; }
.col-row__desc { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.col-row__meta { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.col-row__actions { display: flex; gap: var(--space-2); align-items: flex-start; flex-shrink: 0; }

.rename summary { list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.rename__form { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-2); }
.rename__form input {
    padding: 7px 9px; background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
}

.empty { text-align: center; color: var(--text-muted); }
.empty__hint { font-size: var(--fs-sm); }

/* ---------- Vue d'une collection (inventaire) ---------- */
.inv-filter { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.inv-filter .ps__input { flex: 1; min-width: 180px; margin: 0; }
.inv-filter__color { display: flex; gap: var(--space-2); align-items: center; }

.inv-counts { color: var(--text-muted); font-size: var(--fs-sm); margin: var(--space-3) 0; }
.inv-list { list-style: none; margin: 0; padding: 0; }
.inv-row { display: flex; align-items: center; gap: var(--space-3); padding: 8px 6px; border-bottom: 1px solid var(--border); }
.inv-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; border-radius: var(--radius); }
a.inv-row__main:hover .inv-row__name { text-decoration: underline; }
.inv-row__name { font-size: var(--fs-sm); }
.inv-row__note { font-size: 12px; }

/* Fiche élément (consultation / édition) */
.item-card { display: flex; flex-direction: column; gap: var(--space-5); }
.item-id { display: flex; gap: var(--space-4); align-items: flex-start; }
.item-id__img { flex: 0 0 auto; }
.item-id__img img { width: 110px; height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; }
.item-id__name { margin: 0 0 4px; font-size: var(--fs-lg); }
.item-id__meta { margin: 0; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item-id__ref { font-family: monospace; }
.item-id__ext { margin: var(--space-2) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--fs-sm); color: var(--text-muted); }
.item-id__ext code { color: var(--text); }
.item-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); align-items: end; }
.item-form__row { display: flex; flex-direction: column; gap: 4px; }
.item-form__row--full { grid-column: 1 / -1; }
.item-form__qty { width: 100px; }
.item-form__note { width: 100%; box-sizing: border-box; padding: 8px 10px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); font: inherit; resize: vertical; }
.item-form__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-4); }
.item-form__updated { color: var(--text-muted); font-size: 12px; }
.item-prov { list-style: none; margin: 4px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius); font-size: var(--fs-sm); }
.item-prov li { padding: 2px 0; }
.item-prov__other { color: var(--text-muted); }

/* Wishlist BrickLink */
.wl-help { margin: var(--space-3) 0; font-size: var(--fs-sm); color: var(--text-muted); }
.wl-form { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; margin-top: var(--space-4); }
.wl-field { display: flex; flex-direction: column; gap: 4px; }
.wl-download { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.wl-note { font-size: 12px; color: var(--text-muted); margin: 0; }
.wl-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.wl-table th, .wl-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.wl-table th.num, .wl-table td.num { text-align: right; }
.wl-ref { color: var(--text-muted); font-family: monospace; font-size: 12px; }
.wl-thumb { width: 44px; }
.wl-thumb img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 4px; display: block; }
.wl-links { display: flex; flex-direction: column; gap: 2px; }
.wl-bl { white-space: nowrap; font-size: 12px; }
.wl-table-wrap { overflow-x: auto; }
.wl-table { min-width: 620px; }

/* Feedback de chargement des turbo-frames (filtres, recherche) */
turbo-frame[aria-busy="true"] { opacity: 0.5; transition: opacity 0.12s ease; }

/* Cibles tactiles confortables sur mobile (token --tap = 44px) */
@media (max-width: 720px) {
    .btn { min-height: var(--tap); }
    .qty__btn { min-width: var(--tap); min-height: var(--tap); }
    .qty__input { min-height: var(--tap); }
    .inv-row { gap: var(--space-4); }
    .inv-row__del .btn { min-width: var(--tap); min-height: var(--tap); }
    .cp__chip { padding: 8px 12px; }
}
.wl-row--covered { color: var(--text-muted); }
.wl-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.wl-badge--missing { background: color-mix(in srgb, var(--danger, #e5524b) 22%, transparent); color: var(--danger, #e5524b); }
.wl-badge--covered { background: color-mix(in srgb, #3ecf8e 22%, transparent); color: #2f9e6e; }
.wl-badge--unmapped { background: var(--surface-2); color: var(--text-muted); }
.inv-row__meta { font-size: 12px; color: var(--text-muted); font-family: monospace; display: flex; align-items: center; gap: 6px; }
.sw { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--border); display: inline-block; flex-shrink: 0; }

.qty { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.qty__btn {
    width: 34px; height: 34px; flex-shrink: 0; cursor: pointer; font-size: 18px; line-height: 1;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
}
.qty__btn:hover { background: var(--surface-2); }
.qty__input {
    width: 56px; text-align: center; padding: 6px;
    background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
    -moz-appearance: textfield; appearance: textfield;
}
.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inv-row__del { flex-shrink: 0; }
.inv-row__del .btn { padding: 6px 9px; }

/* ---------- Flux d'ajout ---------- */
.page__actions { display: flex; align-items: center; gap: var(--space-3); }
.add-result {
    display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left;
    background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--border);
    padding: 8px 6px; cursor: pointer;
}
.add-result:hover { background: var(--surface-2); }
.add-part { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.add-part__name { font-weight: 500; flex: 1; }
.add-part__img {
    flex: 0 0 auto; width: 56px; height: 56px; object-fit: contain;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2px;
}
.add-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: var(--space-4) 0 6px; }
.add-actions { margin-top: var(--space-4); }
.btn--block { display: block; width: 100%; text-align: center; }
.add-step2 { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 720px) {
    .add-step2 { grid-template-columns: minmax(0, 1fr) 260px; }
    .add-step2__side { position: sticky; top: var(--space-4); }
}
.add-merge { margin-top: var(--space-3); padding: var(--space-3); border: 1px solid color-mix(in srgb, #e0a64b 45%, var(--border)); border-radius: var(--radius); }
.add-merge p { margin: 0 0 var(--space-2); }
.add-prints { margin-bottom: var(--space-2); display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.add-prints__current { font-size: var(--fs-sm); color: var(--text-muted); }
.add-element {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3);
    margin: var(--space-3) 0; padding: var(--space-3);
    border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border-radius: var(--radius);
}
.add-element__txt { flex: 1; font-size: var(--fs-sm); }
.add-element em { color: var(--text-muted); font-style: normal; font-family: monospace; }
.add-photo { margin: var(--space-3) 0; }
.recognize { margin-bottom: var(--space-3); }
.recognize__head { font-size: var(--fs-sm); color: var(--text-muted); margin: 0 0 var(--space-2); }

/* Sélecteur de couleur — mode grille (gros carrés) */
.cp--grid { display: block; }
.cp--grid .cp__panel { position: static; width: auto; padding: 0; border: 0; background: transparent; }
.cp--grid .cp__list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 360px; }
.cp--grid .cp__divider { flex: 0 0 100%; } /* séparateur toujours seul sur sa ligne */
.cp__cell {
    display: inline-flex; flex-direction: column; align-items: center; gap: 5px;
    width: 70px; padding: 6px 4px; cursor: pointer;
    background: transparent; border: 2px solid transparent; border-radius: var(--radius);
}
.cp__cell:hover { background: var(--surface-2); }
.cp__cell.is-selected { border-color: var(--accent); }
.cp__cell.is-active { outline: 2px solid var(--accent); outline-offset: 1px; }
.cp__cellsw { width: 52px; height: 52px; border-radius: 8px; border: 1px solid var(--border); }
.cp__cellname { font-size: 11px; color: var(--text-muted); text-align: center; line-height: 1.15; }

/* Modal (popup) */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.modal__box {
    position: relative; width: min(480px, 92vw); max-height: 80vh; overflow: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.prints-list { list-style: none; margin: 0; padding: 0; }

/* ---------- Recherche transversale ---------- */
.gs-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.gs-row { display: flex; align-items: center; gap: var(--space-3); padding: 8px 6px; border-bottom: 1px solid var(--border); }
.gs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gs-name { font-size: var(--fs-sm); }
.gs-meta { font-size: 12px; color: var(--text-muted); font-family: monospace; display: flex; align-items: center; gap: 6px; }
.gs-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gs-badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text); text-decoration: none; cursor: pointer; }
.gs-badge:hover { background: var(--accent); color: var(--accent-text); }
.gs-total { font-size: var(--fs-lg); font-weight: 500; flex-shrink: 0; min-width: 36px; text-align: right; }
.gs-add { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.gs-add__label { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---------- Tableau de bord ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-6); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.kpi__value { font-size: var(--fs-xl); font-weight: 500; line-height: 1.1; }
.kpi__label { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 4px; }

.dash-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); }
.bar-row { display: flex; align-items: center; gap: var(--space-3); margin: 8px 0; }
.bar-label { flex: 0 0 42%; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; min-width: 2px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.25); }
.bar-fill--accent { background: var(--accent); }
.bar-val { flex: 0 0 auto; min-width: 48px; text-align: right; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.dash-about { margin-top: var(--space-6); }
.dash-about summary { cursor: pointer; color: var(--text-muted); font-size: var(--fs-sm); }
.dash-about__body { margin-top: var(--space-3); }

.dash-hero { margin-bottom: var(--space-4); }
.dash-hero__value { font-size: 40px; font-weight: 500; line-height: 1; }
.dash-hero__label { color: var(--text-muted); margin-top: 4px; }
.dash-hero__cmp { margin-top: var(--space-3); display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: var(--fs-sm); }

/* Comparaison visuelle aux sets de référence (boîtes pleines + boîte fractionnaire gris/couleur) */
.setboxes { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.setbox { display: inline-block; }
.setbox img { height: 86px; width: auto; display: block; border-radius: 6px; background: #fff; }
.setbox--split { position: relative; display: inline-block; line-height: 0; border-radius: 6px; overflow: hidden; }
.setbox--split .setbox__gray { filter: grayscale(1) opacity(0.4); }            /* en flux : donne la taille */
.setbox--split .setbox__color {                                              /* superposée, rognée vers le bas */
    position: absolute; left: 0; top: 0; width: 100%; height: 100%;
    object-fit: contain; border-radius: 0;
}
.setbox__pct { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.65); padding: 1px 6px; border-radius: 999px; line-height: 1.4; z-index: 1; }
.setbox__mult { align-self: center; font-size: var(--fs-lg); font-weight: 600; }
.card__sub { font-weight: 400; font-size: 12px; color: var(--text-muted); }

/* Accès rapide aux collections (dashboard) */
.coll-links { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.coll-link {
    display: flex; flex-direction: column; gap: 2px; min-width: 160px;
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface-2); color: inherit; text-decoration: none;
}
.coll-link:hover { border-color: var(--accent); }
.coll-link__name { font-weight: 600; }
.coll-link__meta { font-size: 12px; color: var(--text-muted); }

/* Import d'un set */
.set-preview { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.set-preview__img img { height: 64px; width: auto; border-radius: 4px; background: #fff; display: block; }
.set-preview__txt { display: flex; flex-direction: column; gap: 2px; }
.set-preview__meta { font-size: var(--fs-sm); color: var(--text-muted); }
.set-preview__none { color: var(--text-muted); font-size: var(--fs-sm); }
.set-form { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.set-opt { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.set-form .btn--primary { margin-top: var(--space-2); }
.set-form__hint { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

/* Widget « élément préféré » (détaillé par couleur) */
.fav__head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-3); }
.fav__img { flex: 0 0 auto; }
.fav__img img { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.fav__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fav__name { font-weight: 600; }
.fav__ref { color: var(--text-muted); font-weight: 400; font-family: monospace; }
.fav__total { color: var(--text-muted); font-size: var(--fs-sm); }
.fav__colors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2); }
.fav__color { display: flex; align-items: center; gap: var(--space-2); padding: 4px 8px; background: var(--surface-2); border-radius: var(--radius); }
.fav__cimg { flex: 0 0 auto; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 4px; }
.fav__cimg img { width: 36px; height: 36px; object-fit: contain; }
.fav__cname { flex: 1; min-width: 0; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav__cqty { font-weight: 600; flex-shrink: 0; }

.donut-wrap { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.donut { width: 160px; height: 160px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut::after { content: ''; position: absolute; inset: 26%; background: var(--surface); border-radius: 50%; }
.donut-legend { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); flex: 1; min-width: 160px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.donut-legend .dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.donut-pct { color: var(--text-muted); margin-left: auto; padding-left: 12px; }

.widget__row { display: flex; align-items: center; gap: var(--space-3); }
.widget__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.widget__name { font-size: var(--fs-sm); }
.widget__meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.widget__big { font-size: var(--fs-xl); font-weight: 500; flex-shrink: 0; }

.dual { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-6); }
.dual__col { min-width: 0; }
.dual__title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 var(--space-2); }
