.rewards-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

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

.rewards-header h2 {
    margin: 0 0 4px;
    font-size: 1.4rem;
    color: #1b3a4d;
}

.rewards-balance {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.rewards-balance strong {
    color: #1b4d68;
}

.rewards-history-link {
    font-size: 0.9rem;
    color: #1b4d68;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border: 1px solid #c8d3dc;
    border-radius: 8px;
    white-space: nowrap;
}

.rewards-history-link:hover {
    background: #f1f5f9;
}

/* Section "En attente de toi" */
.rewards-pending-section {
    background: linear-gradient(135deg, #fff5f9 0%, #fdf0ff 100%);
    border: 1.5px solid #f0c0d8;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.rewards-pending-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #8b2252;
}

.rewards-pending-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rewards-pending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #f0c0d8;
    border-radius: 10px;
    padding: 10px 14px;
}

.rewards-pending-who {
    font-weight: 700;
    color: #8b2252;
    font-size: 0.85rem;
    min-width: 56px;
}

.rewards-pending-name {
    flex: 1;
    font-weight: 600;
    color: #1b3a4d;
    font-size: 0.95rem;
}

.rewards-pending-date {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* Section "Mes achats en attente" */
.rewards-mypending-section {
    background: #f8faff;
    border: 1.5px solid #c8d8f0;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.rewards-mypending-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rewards-mypending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #c8d8f0;
    border-radius: 10px;
    padding: 10px 14px;
}

.rewards-mypending-name {
    flex: 1;
    font-weight: 600;
    color: #1b3a4d;
    font-size: 0.95rem;
}

.rewards-mypending-date {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* Titre de section */
.rewards-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1b3a4d;
    margin: 0 0 14px;
}

/* Grille boutique */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.reward-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.reward-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.reward-card-body {
    padding: 16px 16px 10px;
    flex: 1;
}

.reward-card-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: #1b3a4d;
    font-weight: 700;
}

.reward-card-desc {
    margin: 0;
    font-size: 0.83rem;
    color: #64748b;
    line-height: 1.4;
}

.reward-personal-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    margin-bottom: 6px;
}

.reward-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 14px;
    border-top: 1px solid #f1f5f9;
}

.reward-price {
    font-weight: 700;
    color: #1b4d68;
    font-size: 0.9rem;
}

.buy-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    background: #1b4d68;
    color: #fff;
    transition: background 0.15s;
}

.buy-btn:hover:not(:disabled) {
    background: #163e56;
}

.buy-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

.rewards-consume-btn {
    padding: 5px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    background: #e8f5ee;
    color: #1a6640;
    border: 1px solid #b6dfc8;
    transition: background 0.15s;
    white-space: nowrap;
}

.rewards-consume-btn:hover {
    background: #d0eddf;
}

.rewards-empty {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Section gestion */
.rewards-manage-section {
    margin-top: 32px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.rewards-manage-toggle {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
    list-style: none;
    padding: 4px 0;
}

.rewards-manage-toggle::-webkit-details-marker { display: none; }

.rewards-manage-body {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rewards-manage-subtitle {
    margin: 0 0 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
}

.reward-edit-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reward-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.reward-form-row .tc-input {
    flex: 1;
}

.reward-form-profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 0.85rem;
}

.reward-form-label {
    font-size: 0.82rem;
    color: #64748b;
}

.reward-form-check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    color: #334155;
}

.reward-form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.rewards-delete-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    transition: background 0.15s;
}

.rewards-delete-btn:hover {
    background: #fecaca;
}

.rewards-manage-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rewards-manage-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.reward-inline-edit {
    width: 100%;
}

.reward-inline-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    font-size: 0.88rem;
    background: #f8fafc;
}

.reward-inline-summary::-webkit-details-marker { display: none; }

.reward-inline-summary span:first-child {
    font-weight: 600;
    color: #1b3a4d;
}

.reward-inline-price {
    font-size: 0.8rem;
    color: #64748b;
}

.reward-inline-edit[open] .reward-inline-summary {
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.reward-inline-edit .reward-edit-form {
    padding: 12px 14px;
}

@media (max-width: 560px) {
    .rewards-grid {
        grid-template-columns: 1fr;
    }

    .rewards-pending-item,
    .rewards-mypending-item {
        flex-wrap: wrap;
        gap: 6px;
    }
}
