/* ============================================
   MODALE MON COMPTE - DESKTOP & MOBILE
   ============================================ */

/* Desktop - Modale centrée */
@media (min-width: 769px) {
    #accountModal {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.95);
        width: 90%;
        max-width: 480px;
        max-height: 90vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 24px;
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
        z-index: 10000 !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.2s;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    #accountModal.active {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
        transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
    }
}

/* Mobile - Bottom Sheet */
@media (max-width: 768px) {
    #accountModal {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        z-index: 10000 !important;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    #accountModal.active {
        transform: translateY(0);
    }
}

/* Contenu de la modale */
.account-modal__content {
    padding: 35px 30px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .account-modal__content {
        padding: 30px 20px;
        max-height: calc(90vh - env(safe-area-inset-bottom, 20px));
    }
    
    /* Handle mobile */
    .account-modal__content::before {
        content: '';
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
}

/* Header avec avatar */
.account-modal__header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.account-modal__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 8px 20px rgba(184, 70, 31, 0.3);
}

.account-modal__name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.account-modal__email {
    font-size: 14px;
    color: #666;
}

/* Menu items */
.account-modal__menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #1a1a1a;
}

.account-menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.account-menu-item:active {
    transform: translateY(0);
}

.account-menu-item__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.account-menu-item--logout .account-menu-item__icon {
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
}

.account-menu-item--admin .account-menu-item__icon--admin {
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    box-shadow: 0 4px 12px rgba(184, 70, 31, 0.3);
}

.account-menu-item--admin {
    border: 2px solid rgba(184, 70, 31, 0.2);
    background: linear-gradient(135deg, rgba(184, 70, 31, 0.05) 0%, rgba(216, 90, 46, 0.05) 100%);
}

.account-menu-item--admin:hover {
    border-color: rgba(184, 70, 31, 0.4);
    background: linear-gradient(135deg, rgba(184, 70, 31, 0.1) 0%, rgba(216, 90, 46, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 70, 31, 0.2);
}

.account-menu-item__content {
    flex: 1;
}

.account-menu-item__title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.account-menu-item__subtitle {
    font-size: 13px;
    color: #666;
}

/* Bouton fermer */
.account-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(184, 70, 31, 0.08);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #B8461F;
    transition: all 0.2s ease;
    z-index: 10;
}

.account-modal__close:hover {
    background: rgba(184, 70, 31, 0.15);
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .account-modal__close {
        top: 15px;
        right: 15px;
    }
}

/* Overlay */
#accountOverlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 9999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    pointer-events: none;
}

#accountOverlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: opacity 0.3s ease, visibility 0s 0s;
}

/* Indicateur utilisateur connecté */
.user-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.icon-btn.user-logged-in {
    position: relative;
}

.icon-btn.user-logged-in svg {
    stroke: #B8461F;
}

/* Badge nom d'utilisateur - 4 caractères max */
.user-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #B8461F;
}

/* Sur mobile, masquer le badge texte */
@media (max-width: 768px) {
    .user-badge {
        display: none;
    }
}

/* ============================================
   FORMULAIRE MON COMPTE
   ============================================ */

/* Vues */
#accountMenuView,
#accountFormView {
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header du formulaire */
.account-form__header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.account-form__back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(184, 70, 31, 0.08);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #B8461F;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.account-form__back:hover {
    background: rgba(184, 70, 31, 0.15);
    transform: translateX(-2px);
}

.account-form__title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

/* Formulaire */
.account-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .account-form {
        max-height: calc(75vh - 80px);
        gap: 18px;
    }
}

@media (min-width: 769px) {
    .account-form {
        max-height: 500px;
    }
}

/* Scrollbar personnalisée */
.account-form::-webkit-scrollbar {
    width: 6px;
}

.account-form::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.account-form::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.account-form::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Sections du formulaire */
.account-form__section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.account-form__section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Toggle pour le mot de passe */
.account-form__toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(184, 70, 31, 0.08);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #B8461F;
    transition: all 0.2s ease;
}

.account-form__toggle:hover {
    background: rgba(184, 70, 31, 0.15);
}

.account-form__toggle.active i {
    transform: rotate(180deg);
}

.account-form__toggle i {
    transition: transform 0.2s ease;
}

/* Champs du formulaire */
.account-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.account-form__field label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.account-form__field input {
    padding: 11px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 16px; /* 16px minimum pour éviter le zoom automatique sur iOS */
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

/* Input avec icône (pour le toggle du mot de passe) */
.account-form__field .input-with-icon {
    position: relative;
    display: block;
    width: 100%;
}

.account-form__field .input-with-icon input {
    padding-right: 44px;
}

.account-form__field .input-icon-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 10 !important;
}

.account-form__field .input-icon-btn:hover {
    color: #B8461F !important;
    background: rgba(184, 70, 31, 0.08) !important;
}

.account-form__field .input-icon-btn:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.account-form__field .input-icon-btn i {
    font-size: 14px;
}

.account-form__field input:focus {
    outline: none;
    border-color: #B8461F;
    background: white;
    box-shadow: 0 0 0 3px rgba(184, 70, 31, 0.1);
}

.account-form__field input::placeholder {
    color: #999;
}

/* Rangée de champs (2 colonnes) */
.account-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .account-form__row {
        grid-template-columns: 1fr;
    }
}

/* Champs mot de passe */
.account-form__password-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Bouton submit */
.account-form__submit {
    padding: 14px 24px;
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.account-form__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(184, 70, 31, 0.4);
    background: linear-gradient(135deg, #8B2F0F 0%, #B8461F 100%);
}

.account-form__submit:active {
    transform: translateY(0);
}

.account-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Animation de transition entre les vues */
#accountMenuView,
#accountFormView {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MY ORDERS SECTION
   ============================================ */

.account-orders {
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

@media (max-width: 768px) {
    .account-orders {
        max-height: calc(75vh - 80px);
    }
}

@media (min-width: 769px) {
    .account-orders {
        max-height: 500px;
    }
}

.account-orders::-webkit-scrollbar {
    width: 6px;
}

.account-orders::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.account-orders::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.account-orders__loading,
.account-orders__empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.account-orders__loading i,
.account-orders__empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.account-orders__loading i {
    color: #B8461F;
    opacity: 1;
}

.account-orders__empty p {
    font-size: 15px;
    margin-bottom: 20px;
}

.account-orders__shop-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-orders__shop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(184, 70, 31, 0.4);
}

.account-orders__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-order-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-order-card:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(184, 70, 31, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.account-order-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.account-order-card__number {
    font-size: 16px;
    font-weight: 700;
    color: #B8461F;
}

.account-order-card__status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.account-order-card__status--pending {
    background: #FEF3C7;
    color: #D97706;
}

.account-order-card__status--processing {
    background: #DBEAFE;
    color: #2563EB;
}

.account-order-card__status--shipped {
    background: #E0E7FF;
    color: #6366F1;
}

.account-order-card__status--delivered {
    background: #D1FAE5;
    color: #059669;
}

.account-order-card__info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-order-card__date {
    font-size: 13px;
    color: #666;
}

.account-order-card__items {
    font-size: 13px;
    color: #666;
}

.account-order-card__amount {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.account-order-card__tracking {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.account-order-card__tracking i {
    color: #B8461F;
}

/* ============================================
   USER ORDER DETAIL MODAL
   ============================================ */

.user-order-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.user-order-modal.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s 0s;
}

.user-order-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.user-order-modal__content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-order-modal.active .user-order-modal__content {
    transform: scale(1);
}

@media (max-width: 768px) {
    .user-order-modal__content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 24px 24px 0 0;
        position: fixed;
        bottom: 0;
        top: auto;
        transform: translateY(100%);
    }
    
    .user-order-modal.active .user-order-modal__content {
        transform: translateY(0);
    }
}

.user-order-modal__header {
    padding: 24px 28px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.user-order-modal__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #B8461F;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-order-modal__close {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
    color: #666;
}

.user-order-modal__close:hover {
    background: #e5e5e5;
    transform: rotate(90deg);
}

.user-order-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

@media (max-width: 768px) {
    .user-order-modal__header {
        padding: 20px;
    }
    
    .user-order-modal__title {
        font-size: 18px;
    }
    
    .user-order-modal__body {
        padding: 20px;
    }
}

.user-order-modal__loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.user-order-modal__loading i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #B8461F;
}

/* Order detail content */
.order-detail {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.order-detail__section {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
}

.order-detail__section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-detail__section-title i {
    color: #B8461F;
}

.order-detail__info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 480px) {
    .order-detail__info-grid {
        grid-template-columns: 1fr;
    }
}

.order-detail__info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-detail__info-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.order-detail__info-value {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.order-detail__items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-detail__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.order-detail__item-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
    flex-shrink: 0;
}

.order-detail__item-info {
    flex: 1;
    min-width: 0;
}

.order-detail__item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-detail__item-details {
    font-size: 13px;
    color: #666;
}

.order-detail__item-price {
    font-size: 16px;
    font-weight: 700;
    color: #B8461F;
    flex-shrink: 0;
}

.order-detail__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    border-radius: 12px;
    color: white;
}

.order-detail__total-label {
    font-size: 16px;
    font-weight: 600;
}

.order-detail__total-value {
    font-size: 28px;
    font-weight: 800;
}

@media (max-width: 480px) {
    .order-detail__item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-detail__item-image {
        width: 100%;
        height: 150px;
    }
}

/* Bouton de suppression de commande */
.order-detail__delete-btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: 16px;
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.order-detail__delete-btn:hover {
    background: linear-gradient(135deg, #B91C1C 0%, #DC2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

.order-detail__delete-btn:active {
    transform: translateY(0);
}

.order-detail__delete-btn i {
    font-size: 16px;
}


/* ============================================
   MY BALANCE SECTION
   ============================================ */

.account-balance {
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

@media (max-width: 768px) {
    .account-balance {
        max-height: calc(75vh - 80px);
    }
}

.account-balance::-webkit-scrollbar {
    width: 6px;
}

.account-balance::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.account-balance::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Carte solde */
.balance-card {
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(184, 70, 31, 0.3);
}

.balance-card__icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.balance-card__content {
    flex: 1;
}

.balance-card__label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-weight: 500;
}

.balance-card__amount {
    font-size: 36px;
    font-weight: 800;
    color: white;
}

/* Ajouter carte cadeau */
.balance-add-card {
    background: rgba(184, 70, 31, 0.05);
    border: 2px solid rgba(184, 70, 31, 0.2);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
}

.balance-add-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-add-card h3 i {
    color: #B8461F;
}

.balance-add-card__description {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
}

.balance-add-card__form {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.balance-add-card__form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 1px;
}

.balance-add-card__form input:focus {
    outline: none;
    border-color: #B8461F;
    box-shadow: 0 0 0 3px rgba(184, 70, 31, 0.1);
}

.btn-add-to-balance {
    padding: 12px 24px;
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add-to-balance:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 70, 31, 0.3);
}

.balance-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.balance-message--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.balance-message--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Historique */
.balance-history {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 14px;
    padding: 20px;
}

.balance-history h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-history h3 i {
    color: #B8461F;
}

.balance-history__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.balance-history__loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.balance-history__loading i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #B8461F;
}

.balance-history__empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.balance-history__item {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.balance-history__item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.balance-history__item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.balance-history__item-icon--credit {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.balance-history__item-icon--debit {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.balance-history__item-info {
    flex: 1;
    min-width: 0;
}

.balance-history__item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.balance-history__item-date {
    font-size: 12px;
    color: #666;
}

.balance-history__item-amount {
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.balance-history__item-amount--credit {
    color: #10b981;
}

.balance-history__item-amount--debit {
    color: #ef4444;
}

/* Style pour le menu item balance */
.account-menu-item--balance .account-menu-item__icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.account-menu-item--balance:hover {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

@media (max-width: 480px) {
    .balance-add-card__form {
        flex-direction: column;
    }
    
    .btn-add-to-balance {
        width: 100%;
        justify-content: center;
    }
}
