/* =============================================================================
   RESSOURCES by Fitness Challenges — feuille de styles globale (MVP)
   Palette : Navy #1B3A6B · Bleu clair #C8DFF4 · Orange #E8672A
   ============================================================================= */

* { box-sizing: border-box; }

:root {
    --color-bg: #f4f6fa;
    --color-surface: #ffffff;
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-primary: #1B3A6B;          /* Navy */
    --color-primary-hover: #16305a;
    --color-primary-soft: #C8DFF4;     /* Bleu clair */
    --color-accent: #E8672A;           /* Orange (CTA d'action) */
    --color-accent-hover: #d1571d;
    --color-success-bg: #d1fae5;
    --color-success-text: #065f46;
    --color-error-bg: #fee2e2;
    --color-error-text: #991b1b;
    --shadow-card: 0 4px 12px rgba(27, 58, 107, 0.08);
    --radius: 8px;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    font-size: 15px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* -----------------------------------------------------------------------------
   Auth pages
   ----------------------------------------------------------------------------- */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 32px;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-brand {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-version {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--color-text-muted);
}

.auth-title {
    margin: 0 0 24px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.auth-helper {
    margin: -16px 0 24px;
    font-size: 14px;
    color: var(--color-text-muted);
    text-align: center;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-link { text-align: center; font-size: 14px; margin: 16px 0 0; }

/* -----------------------------------------------------------------------------
   Form fields
   ----------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--color-text); }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field textarea,
.field select {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
}
.btn--primary:hover { background: var(--color-primary-hover); }

.btn--block { width: 100%; }

/* -----------------------------------------------------------------------------
   App shell (sidebar + topbar + content)
   ----------------------------------------------------------------------------- */

.app-body { background: var(--color-bg); min-height: 100vh; }

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* permet aux enfants de shrink correctement */
}

.app-content {
    padding: 24px 32px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
}
.app-content--wide { max-width: none; }

/* -----------------------------------------------------------------------------
   Sidebar
   ----------------------------------------------------------------------------- */

.sidebar {
    width: 240px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar__brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    border-bottom: 1px solid #1e293b;
}

.sidebar__brand-name { font-weight: 700; font-size: 16px; color: #fff; }
.sidebar__brand-version { font-size: 11px; color: #64748b; }

.sidebar__client {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #1e293b;
}

.sidebar__client-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #1e293b;
}

.sidebar__client-logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.sidebar__client-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar__client-label { font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }

.sidebar__client-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__nav {
    padding: 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__separator {
    margin: 16px 8px 6px;
    font-size: 10px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 14px;
    text-decoration: none;
    transition: background 120ms, color 120ms;
}

.sidebar__item:hover { background: #1e293b; color: #fff; text-decoration: none; }

.sidebar__item--active {
    background: #2563eb;
    color: #fff;
}

.sidebar__item--active:hover { background: #1d4ed8; }

.sidebar__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.sidebar__icon svg { width: 100%; height: 100%; }

.sidebar__label { flex: 1; }

.sidebar__badge {
    background: #475569;
    color: #cbd5e1;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.sidebar__client-switch { padding: 12px 16px; border-top: 1px solid #1e293b; }
.sidebar__switch-btn {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 6px 10px;
    width: 100%;
    cursor: pointer;
    font-size: 12px;
}
.sidebar__switch-btn:hover { background: #1e293b; color: #fff; }

/* -----------------------------------------------------------------------------
   Topbar
   ----------------------------------------------------------------------------- */

.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.topbar__user { position: relative; }

.topbar__user-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 120ms;
}
.topbar__user-summary::-webkit-details-marker { display: none; }
.topbar__user-summary:hover { background: var(--color-bg); }

.topbar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.topbar__user-name { font-size: 13px; font-weight: 500; }

.topbar__badge {
    font-size: 10px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.topbar__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 8px;
    min-width: 220px;
    z-index: 20;
}

.topbar__menu-info {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.topbar__menu-info strong { font-size: 13px; }
.topbar__menu-info span { font-size: 12px; color: var(--color-text-muted); }

.topbar__menu-link {
    display: block;
    padding: 8px 12px;
    color: var(--color-text);
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.topbar__menu-link:hover { background: var(--color-bg); text-decoration: none; }
.topbar__menu-link--danger { color: #dc2626; }
.topbar__menu-form { margin: 0; padding: 0; }

/* -----------------------------------------------------------------------------
   Page header générique (titre + actions)
   ----------------------------------------------------------------------------- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.page-header__subtitle {
    color: var(--color-text-muted);
    font-size: 13px;
    margin: 4px 0 0;
}

/* -----------------------------------------------------------------------------
   Cards
   ----------------------------------------------------------------------------- */

.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.card__body { padding: 20px; }

/* -----------------------------------------------------------------------------
   Tables
   ----------------------------------------------------------------------------- */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th, .table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background: var(--color-bg);
    font-weight: 600;
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table tr:last-child td { border-bottom: none; }

.table--clickable tr:hover { background: var(--color-bg); cursor: pointer; }

/* -----------------------------------------------------------------------------
   Buttons (extension)
   ----------------------------------------------------------------------------- */

.btn--secondary {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}
.btn--secondary:hover { background: var(--color-bg); }

.btn--ghost {
    background: transparent;
    color: var(--color-text-muted);
}
.btn--ghost:hover { color: var(--color-text); background: var(--color-bg); }

.btn--danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}
.btn--danger:hover { background: #fecaca; }

.btn--sm { padding: 6px 10px; font-size: 12px; }

/* -----------------------------------------------------------------------------
   Badges
   ----------------------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge--gray { background: #e5e7eb; color: #374151; }
.badge--blue { background: #dbeafe; color: #1e40af; }
.badge--green { background: #d1fae5; color: #065f46; }
.badge--amber { background: #fef3c7; color: #92400e; }
.badge--red { background: #fee2e2; color: #991b1b; }
.badge--purple { background: #ede9fe; color: #5b21b6; }

/* Mini-avatar à initiales dans la liste admin « Nos experts » */
.expert-mini-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    color: #fff; font-size: 14px; font-weight: 700;
    background: linear-gradient(135deg, #6f9cbe, #5C8AAF);
}
.expert-mini-avatar--steel { background: linear-gradient(135deg, #6f9cbe, #5C8AAF); }
.expert-mini-avatar--navy { background: linear-gradient(135deg, #5C8AAF, #1B3A6B); }
.expert-mini-avatar--orange { background: linear-gradient(135deg, #f0894f, #E8672A); }

/* Ressources : arborescence des catégories (colonne gauche) + liste (droite) */
.res-layout { display: flex; gap: 20px; align-items: flex-start; }
.res-tree { width: 300px; flex-shrink: 0; }
.res-list { flex: 1; min-width: 0; }
@media (max-width: 900px) {
    .res-layout { flex-direction: column; }
    .res-tree { width: 100%; }
}
.cat-tree__all {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: 8px; font-weight: 600; color: var(--color-text, #1f2937);
}
.cat-tree__all:hover { background: #f3f4f6; }
.cat-tree__all.is-active { background: #eaf1f7; color: #1B3A6B; }
.cat-tree { list-style: none; margin: 6px 0 0; padding: 0; }
.cat-tree .cat-tree { margin: 0; padding-left: 14px; border-left: 1px solid var(--color-border, #e5e7eb); margin-left: 8px; }
.cat-tree__item { margin: 1px 0; }
.cat-tree__link {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 6px 10px; border-radius: 8px; color: var(--color-text, #374151); font-size: 14px;
}
.cat-tree__link:hover { background: #f3f4f6; }
.cat-tree__link.is-active { background: #eaf1f7; color: #1B3A6B; font-weight: 700; }
.cat-tree__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-tree__count {
    flex-shrink: 0; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px;
    background: #e5e7eb; color: #374151; font-size: 12px; font-weight: 600;
}
.cat-tree__link.is-active .cat-tree__count { background: #1B3A6B; color: #fff; }

/* Ligne de recherche sous les titres de colonnes (ressources) */
.table-filters th { padding: 6px 8px; background: #fafafa; }
.table-filters input {
    width: 100%; box-sizing: border-box; padding: 6px 8px;
    border: 1px solid var(--color-border, #e5e7eb); border-radius: 6px;
    font-size: 13px; font-weight: 400;
}
.table-filters input:focus { outline: none; border-color: #5C8AAF; box-shadow: 0 0 0 3px rgba(92,138,175,0.18); }

/* Mode réorganisation (drag-and-drop des ressources) */
.reorder-mode tbody tr { cursor: grab; }
.reorder-mode tbody tr.dragging { opacity: .5; background: #eef4fa; }
.reorder-mode tbody td:last-child { visibility: hidden; }           /* masque les actions pendant le tri */
.reorder-mode tbody a { pointer-events: none; color: inherit; }     /* évite d'ouvrir un lien en glissant */
.reorder-mode tbody td:first-child strong::before { content: "\2807"; color: #9aa7b5; margin-right: 8px; }

/* -----------------------------------------------------------------------------
   Product detail header (image + meta)
   ----------------------------------------------------------------------------- */

.product-detail-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.product-detail-header__image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
    display: block;
    text-decoration: none;
    transition: transform 120ms;
}

.product-detail-header__image:hover {
    transform: scale(1.02);
    text-decoration: none;
}

.product-detail-header__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-header__no-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    opacity: 0.4;
}

.product-detail-header__body {
    flex: 1;
    min-width: 0;
}

@media (max-width: 600px) {
    .product-detail-header { flex-direction: column; }
    .product-detail-header__image,
    .product-detail-header__no-image { width: 100%; height: 200px; }
}

/* Liste des avis (page /avis/{id}) */
.reviews-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.review {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.review:last-child { border-bottom: none; }

.review__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.review__date {
    color: var(--color-text-muted);
    font-size: 12px;
    margin-left: 8px;
}

.review__title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}

.review__body {
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.5;
}

.review__edit {
    padding: 14px;
    background: #f9fafb;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review__edit-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.review__edit-row .field { min-width: 140px; }

.review__edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.review__edit-status {
    flex: 1;
    font-size: 13px;
    color: var(--color-text-muted);
}

.review-edit-btn,
.review-delete-btn {
    padding: 4px 8px;
    font-size: 14px;
}

/* Bloc promo flash sous le bloc marge */
.flash-promo {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 24px;
}

.flash-promo__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.flash-promo__title {
    margin: 0;
    color: #92400e;
    font-size: 14px;
    font-weight: 700;
}

.flash-promo__active {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: var(--radius);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.flash-promo__active-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.flash-promo__form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.flash-promo__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 0 1 auto;
}

.flash-promo__label {
    font-size: 11px;
    color: #78350f;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.flash-promo__field input[type="text"],
.flash-promo__field input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
    font-family: inherit;
    color: var(--color-text);
    width: 140px;
}

.flash-promo__field input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.flash-promo__input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flash-promo__input-group input {
    flex: 1;
}

.flash-promo__suffix {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.flash-promo__or {
    align-self: flex-end;
    padding-bottom: 10px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.flash-promo__submit {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

.flash-promo__submit:hover {
    background: #d97706;
    border-color: #d97706;
}

@media (max-width: 800px) {
    .flash-promo__form { flex-direction: column; align-items: stretch; }
    .flash-promo__field input[type="text"],
    .flash-promo__field input[type="date"] { width: 100%; }
    .flash-promo__or { align-self: center; padding: 0; }
}

/* Encart marge dans le header produit */
.margin-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 12px;
    background: #f9fafb;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.margin-box__cell {
    flex: 1 1 110px;
    padding: 8px 14px;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.margin-box__cell:last-child { border-right: none; }

.margin-box__label {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.margin-box__cell strong {
    font-size: 14px;
    font-weight: 600;
}

.margin-box__positive { color: #059669; }
.margin-box__negative { color: #dc2626; }

/* Galerie d'images produit en bas de la page detail */
.product-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.product-gallery__item {
    display: block;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    transition: transform 120ms, border-color 120ms;
}

.product-gallery__item:hover {
    transform: scale(1.03);
    border-color: var(--color-primary);
    text-decoration: none;
}

.product-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* -----------------------------------------------------------------------------
   Product grid (liste produits)
   ----------------------------------------------------------------------------- */

.produits-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.produits-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--color-surface);
    font-family: inherit;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 120ms, box-shadow 120ms, border-color 120ms;
}

.product-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border-color: var(--color-primary);
}

.product-card__image {
    aspect-ratio: 1;
    background: var(--color-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__no-image {
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}
.product-card__no-image span { font-size: 28px; opacity: 0.5; }

.product-card__body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.product-card__name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--color-text);
}

.product-card__ref {
    font-size: 11px;
    color: var(--color-text-muted);
    font-family: ui-monospace, SFMono-Regular, monospace;
}

.product-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
    gap: 4px;
}

.product-card__price {
    font-weight: 600;
    font-size: 14px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
}

.pagination__info {
    color: var(--color-text-muted);
    font-size: 13px;
}

.btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* -----------------------------------------------------------------------------
   Category detail (2 colonnes côte à côte)
   ----------------------------------------------------------------------------- */

.cat-detail__columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .cat-detail__columns { grid-template-columns: 1fr; }
}

.cat-detail__html {
    max-height: 280px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    font-size: 14px;
    line-height: 1.5;
}
.cat-detail__html p:first-child { margin-top: 0; }
.cat-detail__html p:last-child { margin-bottom: 0; }
.cat-detail__html h2 { font-size: 16px; margin-top: 12px; }
.cat-detail__html h3 { font-size: 15px; }
.cat-detail__html img { max-width: 100%; height: auto; }

.cat-detail__readonly {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    font-size: 13px;
    min-height: 38px;
    color: var(--color-text);
}

.cat-detail__push-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.cat-detail__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.cat-detail__actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.cat-detail__actions .btn { flex: 1; }

.ai-gen-panel {
    padding: 14px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-gen-panel .field__label {
    color: #6b21a8;
    font-weight: 600;
}

.ai-gen-result {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13px;
}

.ai-gen-result--ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.ai-gen-result--ko {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border: 1px solid #fecaca;
}

/* -----------------------------------------------------------------------------
   Filter pills
   ----------------------------------------------------------------------------- */

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 120ms, border-color 120ms;
}

.filter-pill:hover {
    background: var(--color-bg);
    text-decoration: none;
}

.filter-pill--active {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}

.filter-pill--active:hover {
    background: #000;
    color: #fff;
}

/* -----------------------------------------------------------------------------
   Tabs
   ----------------------------------------------------------------------------- */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tabs__item {
    padding: 10px 16px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 120ms, border-color 120ms;
}

.tabs__item:hover { color: var(--color-text); text-decoration: none; }

.tabs__item--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tabs__panel { display: block; }

/* -----------------------------------------------------------------------------
   PrestaShop test result
   ----------------------------------------------------------------------------- */

.ps-test-result {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-top: 16px;
    border: 1px solid transparent;
}

.ps-test-result--ok {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border-color: rgba(5, 150, 105, 0.2);
}

.ps-test-result--ko {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border-color: rgba(220, 38, 38, 0.2);
}

/* -----------------------------------------------------------------------------
   API key rows (settings)
   ----------------------------------------------------------------------------- */

.api-key-row {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.api-key-row:last-child { margin-bottom: 0; }

.api-key-row__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.api-key-row__desc {
    color: var(--color-text-muted);
    font-size: 13px;
    margin: 0 0 8px;
}

.api-key-row__masked {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0 0 8px;
}

.api-key-row__form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.api-key-row__form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
}

/* -----------------------------------------------------------------------------
   KPI cards (dashboard)
   ----------------------------------------------------------------------------- */

.kpi-card {
    display: block;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid transparent;
    transition: transform 120ms, box-shadow 120ms;
}

.kpi-card:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.kpi-card__label {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 6px;
}

.kpi-card__value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-card__hint {
    font-size: 13px;
    color: var(--color-text-muted);
}

.kpi-card--blue { border-left-color: #3b82f6; }
.kpi-card--blue .kpi-card__value { color: #1d4ed8; }

.kpi-card--purple { border-left-color: #a855f7; }
.kpi-card--purple .kpi-card__value { color: #7c3aed; }

.kpi-card--amber { border-left-color: #f59e0b; }
.kpi-card--amber .kpi-card__value { color: #d97706; }

.kpi-card--green { border-left-color: #10b981; }
.kpi-card--green .kpi-card__value { color: #059669; }

/* -----------------------------------------------------------------------------
   Empty states
   ----------------------------------------------------------------------------- */

.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--color-text-muted);
}
.empty-state__title { font-size: 16px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.empty-state__hint { font-size: 13px; }

/* -----------------------------------------------------------------------------
   Forms (étendu)
   ----------------------------------------------------------------------------- */

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid--2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 768px) {
    .form-grid--2col { grid-template-columns: 1fr; }
    .app-content { padding: 16px; }
    .sidebar { width: 200px; }
}

.field__hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.form-actions--end { justify-content: flex-end; }

/* -----------------------------------------------------------------------------
   Flash messages
   ----------------------------------------------------------------------------- */

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.flash {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
}
.flash--success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}
.flash--error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

/* -----------------------------------------------------------------------------
   RESSOURCES — barre d'application (espace membre, lot 1)
   ----------------------------------------------------------------------------- */

.appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    height: 60px;
    background: var(--color-primary);
    color: #fff;
}
.appbar__brand { display: flex; align-items: baseline; gap: 8px; }
.appbar__logo { font-weight: 700; letter-spacing: 0.04em; font-size: 18px; }
.appbar__tagline { font-size: 12px; color: var(--color-primary-soft); }
.appbar__right { display: flex; align-items: center; gap: 16px; }
.appbar__club {
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 10px;
    border-radius: 999px;
}
.appbar__club--admin { background: var(--color-accent); }
.appbar__user { font-size: 14px; color: var(--color-primary-soft); }
.appbar__logout { margin: 0; }
.appbar .btn--ghost { color: #fff; }
.appbar .btn--ghost:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.member-main { max-width: 1080px; margin: 0 auto; padding: 32px 24px; }

.page-head { margin-bottom: 24px; }
.page-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.page-subtitle { margin: 6px 0 0; color: var(--color-text-muted); font-size: 15px; }

/* CTA d'action orange (promos, actions fortes — cf. charte CDC) */
.btn--accent { background: var(--color-accent); color: #fff; }
.btn--accent:hover { background: var(--color-accent-hover); }

/* -----------------------------------------------------------------------------
   RESSOURCES — back-office admin (overrides + composants)
   ----------------------------------------------------------------------------- */
.admin-sidebar { background: var(--color-primary); }               /* navy */
.admin-sidebar .sidebar__brand { border-bottom-color: rgba(255,255,255,0.12); }
.admin-sidebar .sidebar__item { color: #d7e2f2; }
.admin-sidebar .sidebar__item:hover { background: rgba(255,255,255,0.10); color: #fff; }
.sidebar__item--active { background: var(--color-accent, #E8672A); }
.sidebar__item--active:hover { background: #d1571d; }
.sidebar__item--disabled { color: #8ea6c6; cursor: default; opacity: .6; }
.sidebar__item--disabled:hover { background: transparent; }
.sidebar__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.12); border-radius: 0; font-size: 13px; }

.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; height: 60px; background: #fff; border-bottom: 1px solid var(--color-border);
}
.admin-topbar__title { font-size: 18px; font-weight: 700; margin: 0; }
.admin-topbar__right { display: flex; align-items: center; gap: 14px; }
.admin-topbar__user { font-size: 14px; color: var(--color-text-muted); }

.page-actions { margin-bottom: 16px; }
.admin-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.admin-cols .card { margin-bottom: 20px; }

@media (max-width: 900px) {
    .admin-cols { grid-template-columns: 1fr; }
}

/* Grilles de formulaire (admin + compte) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Espace membre — Mon compte */
.appbar__user--link { text-decoration: none; }
.appbar__user--link:hover { text-decoration: underline; }
.account-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.account-cols .card { margin-bottom: 0; }
@media (max-width: 860px) { .account-cols { grid-template-columns: 1fr; } }
.club-facts { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.club-facts > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--color-border); padding-bottom: 8px; }
.club-facts dt { color: var(--color-text-muted); font-size: 13px; margin: 0; }
.club-facts dd { margin: 0; font-weight: 600; text-align: right; }

/* -----------------------------------------------------------------------------
   RESSOURCES — espace membre : colonne de gauche + topbar
   ----------------------------------------------------------------------------- */
.member-sidebar { background: var(--color-primary); }
.member-sidebar .sidebar__brand { border-bottom-color: rgba(255,255,255,0.12); }
.member-sidebar .sidebar__item { color: #d7e2f2; }
.member-sidebar .sidebar__item:hover { background: rgba(255,255,255,0.10); color: #fff; }
.member-sidebar .sidebar__separator { color: #9db6d6; }
.member-sidebar .sidebar__item--disabled { color: #8ea6c6; cursor: default; opacity: .6; }
.member-sidebar .sidebar__item--disabled:hover { background: transparent; }
.member-sidebar .sidebar__badge { background: rgba(255,255,255,0.14); color: #cfe0f3; }
.sidebar__club {
    padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.12);
    color: #fff; font-weight: 600; font-size: 14px;
}

.app-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 60px; background: #fff; border-bottom: 1px solid var(--color-border);
}
.app-topbar__left { display: flex; align-items: center; gap: 12px; }
.app-topbar__title { font-size: 18px; font-weight: 700; margin: 0; }
.app-topbar__right { display: flex; align-items: center; gap: 14px; }
.app-topbar__user { font-size: 14px; color: var(--color-text-muted); text-decoration: none; }
.app-topbar__user:hover { text-decoration: underline; }
.app-topbar__burger { display: none; flex-direction: column; gap: 4px; cursor: pointer; padding: 6px; }
.app-topbar__burger span { width: 22px; height: 2px; background: var(--color-primary); border-radius: 2px; }
.msidebar-toggle { display: none; }

@media (max-width: 860px) {
    .member-sidebar {
        position: fixed; top: 0; left: -260px; bottom: 0; width: 240px; z-index: 60;
        transition: left .2s ease; box-shadow: 0 0 30px rgba(0,0,0,.25);
    }
    .msidebar-toggle:checked ~ .member-sidebar { left: 0; }
    .app-topbar__burger { display: flex; }
}

/* Gestionnaire de catégories (admin Ressources) */
.cat-card { margin-bottom: 16px; }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cat-form { display: flex; align-items: center; gap: 8px; margin: 0; flex: 1; }
.pos-input { width: 56px; padding: 8px 8px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 13px; text-align: center; }
.cat-name-input { flex: 1; max-width: 340px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 14px; }
.subcat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.subcat-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--color-bg); border-radius: 8px; }
.subcat-row .cat-form { flex: 1; }
.subcat-add { display: flex; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px dashed var(--color-border); }
.subcat-add input { flex: 1; max-width: 340px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 14px; }

/* -----------------------------------------------------------------------------
   Bibliothèque membre — grille de ressources + lecteur
   ----------------------------------------------------------------------------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.res-card { display: flex; flex-direction: column; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.res-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(27,58,107,.14); text-decoration: none; }
.res-card__thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1B3A6B, #16305a); display: flex; align-items: center; justify-content: center; }
.res-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.res-card__thumb-ph { font-size: 34px; color: rgba(255,255,255,.85); }
.res-card__duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.72); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 5px; }
.res-card__body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.res-card__title { font-size: 15px; margin: 0; line-height: 1.35; }
.res-card__meta { display: flex; gap: 6px; flex-wrap: wrap; }

.res-detail { max-width: 900px; }
.video-embed { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.res-detail__head { margin-bottom: 16px; }
.res-detail__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.res-detail__cat { color: var(--color-text-muted); font-size: 13px; }
.res-detail__title { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.res-detail .card { margin-bottom: 16px; }

.res-card__desc {
    margin: 0; font-size: 13px; color: var(--color-text-muted); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Logo image (auth + sidebars) */
.auth-logo { height: 96px; width: auto; margin: 0 auto; display: block; }
.sidebar__brand--logo { flex-direction: column; align-items: flex-start; gap: 8px; }
.sidebar__logo { width: 148px; max-width: 100%; height: auto; display: block; }

/* Arborescence de catégories (admin) */
.cat-node { margin-bottom: 4px; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.cat-row:hover { background: var(--color-bg); }
.cat-row__thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: #fff; border: 1px solid var(--color-border); flex-shrink: 0; }
.cat-row__name { font-weight: 600; color: var(--color-text); flex: 1; min-width: 120px; text-decoration: none; }
.cat-row__name:hover { color: var(--color-primary); }
.cat-row__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-subform { display: flex; gap: 6px; align-items: center; margin: 0; }
.cat-subform input { width: 150px; padding: 6px 9px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 13px; }

/* Aperçu miniature catégorie (édition) */
.cat-thumb-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cat-thumb-preview img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; padding: 4px; }
.cat-thumb-note { font-size: 12px; color: var(--color-text-muted); }

/* Colonne "ordre" dans l'arbre des catégories */
.cat-row__pos {
    flex-shrink: 0; min-width: 26px; height: 26px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px;
    font-size: 13px; font-weight: 600; color: var(--color-text-muted);
}

/* Pied de formulaire : Retour à gauche, action à droite */
.form-footer { display: flex; align-items: center; gap: 12px; width: 100%; }
.form-footer .btn--primary { margin-left: auto; }
