:root {
    --primary-color: #271090;
    --primary-rgba: 39, 16, 144;
    --secondary-color: #f7fafc;
    --accent-color: #271090;
    --text-color: #2d3748;
    --light-text: #f8f9fa;
    --shadow: 0 4px 16px rgba(var(--primary-rgba), 0.10);
    --card-radius: 0.95rem;
    --transition: all 0.25s cubic-bezier(.4, 0, .2, 1);
}

/* =========================
   DASHBOARD GENERAL
   ========================= */
.card {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    border: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: 0 10px 32px rgba(var(--primary-rgba), 0.13);
    transform: translateY(-3px) scale(1.01);
}

/* =========================
   WELCOME CARD
   ========================= */
.welcome-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.welcome-card .card-title {
    font-weight: 600;
    color: var(--text-color);
}

/* =========================
   USER BADGES
   ========================= */
.user-badges .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
    margin: 0 0.25rem;
}

/* =========================
   VERIFICATION ALERT
   ========================= */
.verification-alert {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================
   STAT CARDS
   ========================= */
.stat-card {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    border-radius: 1.2rem;
    box-shadow: 0 2px 12px rgba(var(--primary-rgba), 0.07);
    background: #f7fafc;
    padding: 1.2rem 1.5rem;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    border-left: 4px solid var(--accent-color);
}

.stat-card .icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #e3e9f7 0%, #27109022 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.stat-title {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.progress {
    height: 8px;
    border-radius: 6px;
}

.progress-bar {
    border-radius: 6px;
}

/* =========================
   CHARTS
   ========================= */
.chart-card {
    height: 100%;
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 2px 12px rgba(var(--primary-rgba), 0.07);
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-dropdown .dropdown-menu {
    font-size: 0.8125rem;
}

/* =========================
   UPGRADE CARD
   ========================= */
.upgrade-card {
    border: none;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    border-radius: 1.2rem;
    box-shadow: 0 2px 12px rgba(246, 194, 62, 0.09);
}

.upgrade-card .btn-white {
    min-width: 160px;
    border-radius: 0.7rem;
    font-weight: 600;
}

/* =========================
   TABLES
   ========================= */
.table {
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 16px rgba(var(--primary-rgba), 0.07);
    font-size: 0.95rem;
    width: 100%;
}

.table th,
.table td {
    vertical-align: middle;
}

.table thead th {
    border-top: none;
    background: #f6f9fe;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.01rem;
    letter-spacing: 0.01em;
}

.table-hover tbody tr:hover {
    background: #f0f4fa;
}

.table-striped>tbody>tr:nth-of-type(odd) {
    background: #f8fafc;
}

/* =========================
   BADGES
   ========================= */
.badge {
    font-size: 0.95em;
    padding: 0.5em 0.8em;
    border-radius: 0.7em;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 4px rgba(var(--primary-rgba), 0.07);
}

.badge.bg-success {
    background: linear-gradient(90deg, #38d996 60%, #2ecc71 100%);
    color: #fff;
}

.badge.bg-warning,
.badge.bg-warning.text-dark {
    /* background: linear-gradient(90deg, #10B981 60%, #ffe082 100%); */
    color: #222 !important;
}

.badge.bg-info,
.badge.bg-info.text-dark {
    background: var(--primary-color);
    color: #fff !important;
}

.badge.bg-danger {
    background: linear-gradient(90deg, #f5365c 60%, #ff7675 100%);
    color: #fff;
}

.badge.bg-secondary {
    background: #bfc9da;
    color: #fff;
}


.btn-outline-success:hover,
.btn-outline-primary:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.btn-outline-success:focus,
.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(17, 205, 239, 0.15);
}

/* Triangle Card */
.triangle-card {
    overflow: visible;
    position: relative;
}

.triangle-shape {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 32px solid transparent;
    border-right: 32px solid transparent;
    border-bottom: 32px solid var(--primary-color);
    z-index: 1;
    opacity: 0.15;
}

.triangle-card .card-body {
    position: relative;
    z-index: 2;
}

/* Styles de base conservés */
.member-id-card-container {
    cursor: pointer;
    transition: transform 0.3s ease;
    max-width: 340px;
    margin: 2rem auto;
    perspective: 1000px;
}


.member-card-id {
    width: 340px;
    height: 210px;
    background: rgba(39, 16, 144, 0.05);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(39, 16, 144, 0.15);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(39, 16, 144, 0.1);
    display: flex;
    flex-direction: column;
}

.card-background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(39, 16, 144, 0.03) 0%, transparent 100%);
    z-index: 0;
}

/* Badge de confiance */
.trust-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2;
}

.trust-score {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

/* Photo de profil et infos contact */
.profile-picture-container {
    position: absolute;
    top: 24px;
    left: 20px;
    width: 64px;
    z-index: 2;
}

.profile-image {
    width: 64px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: rgba(39, 16, 144, 0.11);
}

.contact-item {
    display: flex;
    align-items: center;
    font-size: 0.65rem;
    color: #666;
    margin-bottom: 0.3rem;
    white-space: nowrap;
}

.icon-carte {
    margin-right: 0.3rem;
    color: #271090;
    width: 12px;
    text-align: center;
    font-size: 0.7rem;
}

/* Nom du membre */
.member-name-container {
    position: absolute;
    top: 24px;
    left: 100px;
    right: 50px;
    max-width: 180px;
}

.member-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #271090;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* QR Code au centre */
.qr-code-center-container {
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    padding: 5px;
    background: rgba(39, 16, 144, 0.05);
    border-radius: 4px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.qr-code-center {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Logo à droite */
.logo-right-container {
    position: absolute;
    bottom: 10px;
    right: 20px;
    width: 55px;
    opacity: 0.9;
}

.logo-right {
    width: 100%;
    height: auto;
}

.contact-info-below-image {
    margin-top: 60px;
    margin-left: 10px;
}


.watermark-text::after {
    content: "ÉQUISOLDO";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 3rem;
    font-weight: 800;
    color: rgba(39, 16, 144, 0.05);
    opacity: 1;
    pointer-events: none;
    z-index: 2;
}

.watermark-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg,
            transparent 65%,
            rgba(39, 16, 144, 0.05) 65%,
            rgba(39, 16, 144, 0.05) 70%,
            transparent 70%),
        linear-gradient(-45deg,
            transparent 65%,
            rgba(39, 16, 144, 0.05) 65%,
            rgba(39, 16, 144, 0.05) 70%,
            transparent 70%);
    background-size: 30px 30px;
    z-index: 2;
}

/* Assurez-vous que les autres éléments sont au-dessus */
.profile-picture-container,
.member-info,
.qr-code-container,
.logo-container {
    position: relative;
    z-index: 2;
}

/* =========================
   GLOBAL RESPONSIVE ADJUSTMENTS
   ========================= */
@media (max-width: 1199.98px) {
    /* Ajustements pour les grands tablettes */
    .welcome-card .card-body {
        padding: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .member-id-card-container {
        max-width: 300px;
    }
    
    .member-card-id {
        width: 300px;
        height: 185px;
    }
    
    .profile-picture-container {
        width: 55px;
    }
    
    .profile-image {
        width: 55px;
        height: 70px;
    }
    
    .member-name {
        font-size: 1rem;
    }
    
    .qr-code-center-container {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 991.98px) {
    /* Ajustements pour tablettes */
    .container-xxl {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .quick-actions .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .suggested-members-scroll {
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .suggested-members-scroll > div {
        min-width: max-content;
    }
    
    .member-card {
        width: 180px;
    }
}

@media (max-width: 767.98px) {
    /* Ajustements pour mobiles horizontaux */
    .welcome-card .card-body {
        padding: 1.25rem;
    }
    
    .user-badges .badge {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .verification-alert {
        width: 100%;
    }
    
    .member-id-card-container {
        max-width: 280px;
        margin: 1rem auto;
    }
    
    .member-card-id {
        width: 280px;
        height: 175px;
    }
    
    .profile-picture-container {
        top: 15px;
        left: 15px;
    }
    
    .member-name-container {
        left: 60px;
        right: 20px;
    }
    
    .qr-code-center-container {
        width: 70px;
        height: 70px;
    }
    
    .watermark-text::after {
        font-size: 2.5rem;
    }
}

@media (max-width: 575.98px) {
    /* Ajustements pour mobiles verticaux */
    .container-xxl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .welcome-card .card-title {
        font-size: 1.25rem;
    }
    
    .card {
        border-radius: 1rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .member-id-card-container {
        max-width: 260px;
    }
    
    .member-card-id {
        width: 260px;
        height: 165px;
    }
    
    .profile-picture-container {
        width: 50px;
    }
    
    .profile-image {
        width: 50px;
        height: 65px;
    }
    
    .member-name {
        font-size: 0.95rem;
    }
    
    .contact-info-below-image {
        margin-top: 30px;
        margin-left: 5px;
    }
    
    .contact-item {
        font-size: 0.6rem;
    }
    
    .qr-code-center-container {
        width: 65px;
        height: 65px;
    }
    
    .logo-right-container {
        width: 45px;
    }
    
    .watermark-text::after {
        font-size: 2rem;
    }
}

/* =========================
   SPECIAL MOBILE ADJUSTMENTS
   ========================= */
@media (max-width: 400px) {
    /* Ajustements très petits écrans */
    .member-id-card-container {
        max-width: 240px;
    }
    
    .member-card-id {
        width: 240px;
        height: 150px;
    }
    
    .profile-picture-container {
        left: 10px;
    }
    
    .profile-image {
        width: 45px;
        height: 60px;
    }
    
    .member-name-container {
        left: 60px;
    }
    
    .member-name {
        font-size: 0.9rem;
    }
    
    .qr-code-center-container {
        width: 60px;
        height: 60px;
        left: 60%;
    }
    
    .contact-info-below-image {
        margin-top: 30px;
        margin-left: 5px;
    }
    
    .logo-right-container {
        right: 10px;
        width: 40px;
    }
    
    .watermark-text::after {
        font-size: 1.8rem;
    }
}

/* =========================
   IMPROVED ELEMENTS RESPONSIVENESS
   ========================= */
/* Quick Actions Buttons */
@media (max-width: 991.98px) {
    .quick-actions .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Stats Cards */
@media (max-width: 767.98px) {
    .stat-card .icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
    
    .stat-title {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
}

/* Suggested Members Cards */
@media (max-width: 1199.98px) {
    .suggested-members-scroll > div {
        gap: 1rem;
    }
    
    .member-card {
        width: 220px;
    }
}

@media (max-width: 991.98px) {
    .member-card {
        width: 200px;
    }
}

@media (max-width: 767.98px) {
    .member-card {
        width: 180px;
    }
    
    .member-card .card-body {
        padding: 1rem;
    }
    
    .member-card img {
        width: 48px;
        height: 48px;
    }
}

/* Charts Container */
@media (max-width: 991.98px) {
    .chart-container {
        height: 220px;
    }
}

/* Upgrade Card */
@media (max-width: 767.98px) {
    .upgrade-card .btn-white {
        min-width: 120px;
        font-size: 0.9rem;
    }
}

/* Tables */
@media (max-width: 991.98px) {
    .table {
        font-size: 0.9rem;
    }
    
    .table thead th {
        font-size: 0.95rem;
    }
}

/* PDF Generation Loader */
.pdf-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.pdf-loader .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}