/**
 * Dashboard B.EASE Hub — /mon-compte/bease-hub/
 *
 * Mobile-first. Préfixé .bh-hub pour ne pas écraser les styles globaux du thème.
 */

.bh-hub {
    --bh-orange:  #E8481C;
    --bh-orange-soft: #fff8f5;
    --bh-dark:    #1a1a1a;
    --bh-light:   #f8f8f8;
    --bh-border:  #eaeaea;
    --bh-muted:   #6b7280;
    --bh-text:    #1f2937;

    max-width: 880px;
    margin: 0 auto;
    color: var(--bh-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bh-hub * { box-sizing: border-box; }

.bh-hub-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--bh-dark);
}

/* ── Bloc A — Hero ─────────────────────────────────────────────────────── */

.bh-hub-hero {
    background: var(--bh-dark);
    color: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 24px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.bh-hub-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.bh-hub-hero-greeting {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.bh-hub-hero-amount {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0 18px;
}

.bh-cashback-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bh-cashback-amount {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.05;
    color: var(--bh-orange);
    letter-spacing: -0.02em;
}

.bh-progress-wrap { margin-top: 8px; }

.bh-progress-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.bh-progress-meta strong { color: #fff; }
.bh-progress-numbers {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
}

.bh-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    overflow: hidden;
}

.bh-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--bh-orange);
    transition: width 0.4s ease;
}

.bh-progress-remaining {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.bh-progress-remaining--max {
    margin-top: 14px;
    font-weight: 600;
    color: #fff;
}

.bh-hub-cta {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 22px;
    background: var(--bh-orange);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.15s, background 0.15s;
}

.bh-hub-cta:hover {
    background: #d23d12;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.bh-hub-cta--ghost {
    background: transparent;
    color: var(--bh-orange);
    border: 1px solid var(--bh-orange);
}

.bh-hub-cta--ghost:hover {
    background: var(--bh-orange);
    color: #fff;
}

/* ── Niveau badge (réutilisé hero + tableau D) ────────────────────────── */

.bh-level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #888;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bh-level-badge--rookie  { background: #888; }
.bh-level-badge--starter { background: #4CAF50; }
.bh-level-badge--allstar { background: #2196F3; }
.bh-level-badge--mvp     { background: #9C27B0; }
.bh-level-badge--legend  { background: var(--bh-orange); }

/* ── Bloc B — Actions rapides ─────────────────────────────────────────── */

.bh-hub-actions { margin-bottom: 28px; }

.bh-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.bh-action-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--bh-border);
    border-radius: 12px;
    background: #fff;
    color: var(--bh-text);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    position: relative;
}

.bh-action-card:hover {
    border-color: var(--bh-orange);
    box-shadow: 0 4px 14px rgba(232, 72, 28, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--bh-text);
}

.bh-action-icon {
    color: var(--bh-orange);
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.bh-action-icon svg { display: block; }

.bh-action-body { display: flex; flex-direction: column; gap: 3px; }
.bh-action-title { font-weight: 700; font-size: 15px; color: var(--bh-dark); }
.bh-action-desc  { font-size: 13px; color: var(--bh-muted); line-height: 1.4; }

.bh-action-badge {
    align-self: flex-start;
    margin-top: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bh-orange-soft);
    color: var(--bh-orange);
    font-size: 12px;
    font-weight: 700;
}

/* ── Bloc C — Historique cashback ─────────────────────────────────────── */

.bh-hub-history { margin-bottom: 28px; }

.bh-history-tablewrap {
    background: #fff;
    border: 1px solid var(--bh-border);
    border-radius: 12px;
    overflow: hidden;
}

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

.bh-history-table thead th {
    text-align: left;
    background: var(--bh-light);
    color: var(--bh-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bh-border);
}

.bh-history-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--bh-border);
    vertical-align: middle;
}

.bh-history-table tbody tr:last-child td { border-bottom: none; }
.bh-history-table tbody tr:nth-child(even) { background: #fbfbfb; }

.bh-cell-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bh-cell-date   { white-space: nowrap; color: var(--bh-muted); }
.bh-cell-balance { color: var(--bh-dark); font-weight: 600; }

.bh-amount--pos { color: #16a34a; font-weight: 700; }
.bh-amount--neg { color: #dc2626; font-weight: 700; }

.bh-history-empty {
    padding: 28px 16px;
    text-align: center;
    background: #fff;
    border: 1px dashed var(--bh-border);
    border-radius: 12px;
}

.bh-history-empty p { margin: 0 0 14px; color: var(--bh-muted); }

.bh-history-more {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px 16px;
    background: #fff;
    color: var(--bh-dark);
    border: 1px solid var(--bh-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.bh-history-more:hover:not(:disabled) {
    border-color: var(--bh-orange);
    color: var(--bh-orange);
}

.bh-history-more:disabled { opacity: 0.5; cursor: wait; }

/* ── Bloc D — Tableau niveaux ─────────────────────────────────────────── */

.bh-hub-levels { margin-bottom: 28px; }

.bh-level-tablewrap {
    background: #fff;
    border: 1px solid var(--bh-border);
    border-radius: 12px;
    overflow-x: auto;
}

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

.bh-level-table thead th {
    text-align: left;
    background: var(--bh-light);
    color: var(--bh-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bh-border);
}

.bh-level-table tbody th,
.bh-level-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--bh-border);
    text-align: left;
    font-weight: 400;
    vertical-align: middle;
}

.bh-level-table tbody tr:last-child th,
.bh-level-table tbody tr:last-child td { border-bottom: none; }

.bh-level-table tbody tr.is-current {
    background: var(--bh-orange-soft);
    box-shadow: inset 4px 0 0 0 var(--bh-orange);
}

.bh-level-table tbody tr.is-current td,
.bh-level-table tbody tr.is-current th { font-weight: 600; }

/* ── Bloc E — Avis en attente ─────────────────────────────────────────── */

.bh-hub-pending { margin-bottom: 28px; }

.bh-pending-reviews {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.bh-pending-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--bh-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--bh-text);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.bh-pending-card:hover {
    border-color: var(--bh-orange);
    box-shadow: 0 4px 14px rgba(232, 72, 28, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--bh-text);
}

.bh-pending-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--bh-light);
    display: block;
}

.bh-pending-image--placeholder { background: linear-gradient(135deg, #eee, #f8f8f8); }

.bh-pending-body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bh-pending-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    color: var(--bh-dark);
    /* clamp à 2 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bh-pending-cta { font-size: 13px; color: var(--bh-orange); font-weight: 700; }

.bh-pending-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    background: var(--bh-orange);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(232, 72, 28, 0.35);
}

/* ── Mobile ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .bh-hub-hero { padding: 22px 18px; border-radius: 12px; }
    .bh-cashback-amount { font-size: 36px; }
    .bh-actions-grid { grid-template-columns: 1fr; }
    .bh-pending-reviews { grid-template-columns: 1fr; }
    .bh-progress-numbers { margin-left: 0; flex-basis: 100%; }
    .bh-history-table thead th,
    .bh-history-table tbody td { padding: 10px 10px; font-size: 13px; }
    .bh-level-table thead th,
    .bh-level-table tbody th,
    .bh-level-table tbody td { padding: 10px 10px; font-size: 13px; }
}
