/* =========================================================
   CRM ACCOUNT SUITE
   Unified account pages and account dropdown
   ========================================================= */

body.crm-account-suite{
    --crm-primary:#2563eb;
    --crm-primary-dark:#1d4ed8;
    --crm-cyan:#0891b2;
    --crm-success:#059669;
    --crm-danger:#dc2626;
    --crm-warning:#d97706;
    --crm-text:#0f172a;
    --crm-muted:#64748b;
    --crm-border:#e2e8f0;
    --crm-surface:#ffffff;
    --crm-soft:#f8fafc;

    background:
        radial-gradient(circle at 85% 5%,rgba(37,99,235,.08),transparent 28%),
        radial-gradient(circle at 5% 40%,rgba(14,165,233,.06),transparent 26%),
        #f8fafc!important;
}

/* ---------- صفحه اصلی محتوا ---------- */

body.crm-account-suite #main-body{
    padding-top:24px!important;
    padding-bottom:45px!important;
}

body.crm-account-suite #main-body > .container{
    max-width:1450px!important;
}

body.crm-account-suite #main-body .row{
    align-items:flex-start;
}

/* مخفی‌کردن سایدبار قدیمی حساب */

body.crm-account-suite.crm-hide-account-sidebar
#main-body .sidebar,

body.crm-account-suite.crm-hide-account-sidebar
#main-body .primary-sidebar,

body.crm-account-suite.crm-hide-account-sidebar
#main-body .secondary-sidebar,

body.crm-account-suite.crm-hide-account-sidebar
#main-body aside[id*="sidebar"],

body.crm-account-suite.crm-hide-account-sidebar
#main-body .col-md-3.sidebar,

body.crm-account-suite.crm-hide-account-sidebar
#main-body .col-lg-3.sidebar,

body.crm-account-suite.crm-hide-account-sidebar
#main-body .col-xl-3.sidebar{
    display:none!important;
}

body.crm-account-suite.crm-hide-account-sidebar
#main-body .primary-content{
    flex:0 0 100%!important;
    width:100%!important;
    max-width:100%!important;
}

/* ---------- هدر عمومی صفحات حساب ---------- */

.crm-account-page-intro{
    position:relative;
    overflow:hidden;
    direction:rtl;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:22px;
    margin-bottom:24px;
    padding:25px 28px;
    border-radius:27px;
    color:#fff;
    background:
        radial-gradient(circle at 8% 0%,rgba(255,255,255,.22),transparent 31%),
        radial-gradient(circle at 95% 100%,rgba(6,182,212,.32),transparent 36%),
        linear-gradient(135deg,#1e40af,#2563eb 48%,#0891b2);
    box-shadow:0 20px 48px rgba(37,99,235,.22);
}

.crm-account-page-intro:before{
    content:"";
    position:absolute;
    width:170px;
    height:170px;
    left:-60px;
    bottom:-105px;
    border:25px solid rgba(255,255,255,.08);
    border-radius:50%;
}

.crm-account-page-intro-content{
    position:relative;
    z-index:2;
    display:flex;
    align-items:center;
    gap:16px;
}

.crm-account-page-intro-icon{
    width:65px;
    height:65px;
    flex:0 0 65px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid rgba(255,255,255,.25);
    border-radius:21px;
    background:rgba(255,255,255,.15);
    backdrop-filter:blur(10px);
}

.crm-account-page-intro-icon svg{
    width:31px;
    height:31px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.crm-account-page-intro h1{
    margin:0 0 7px!important;
    color:#fff!important;
    font-size:24px!important;
    font-weight:950!important;
}

.crm-account-page-intro p{
    margin:0;
    color:rgba(255,255,255,.82);
    font-size:12px;
    line-height:1.9;
}

.crm-account-page-intro-badge{
    position:relative;
    z-index:2;
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:8px 13px;
    border:1px solid rgba(255,255,255,.18);
    border-radius:999px;
    color:#fff;
    background:rgba(255,255,255,.14);
    font-size:11px;
    font-weight:900;
    white-space:nowrap;
}

/* ---------- کارت‌ها ---------- */

body.crm-account-suite #main-body .card{
    overflow:hidden;
    border:1px solid rgba(148,163,184,.20)!important;
    border-radius:24px!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 12px 35px rgba(15,23,42,.07)!important;
}

body.crm-account-suite #main-body .card + .card{
    margin-top:20px;
}

body.crm-account-suite #main-body .card-header{
    padding:18px 21px!important;
    border-bottom:1px solid #edf2f7!important;
    background:
        linear-gradient(135deg,#ffffff,#f8fbff)!important;
    color:var(--crm-text)!important;
}

body.crm-account-suite #main-body .card-body{
    padding:22px!important;
}

body.crm-account-suite #main-body .card-title{
    margin:0!important;
    color:var(--crm-text)!important;
    font-size:16px!important;
    font-weight:950!important;
}

/* ---------- فرم‌ها ---------- */

body.crm-account-suite #main-body label,
body.crm-account-suite #main-body .col-form-label{
    margin-bottom:7px;
    color:#334155!important;
    font-size:11px!important;
    font-weight:900!important;
}

body.crm-account-suite #main-body input.form-control,
body.crm-account-suite #main-body select.form-control,
body.crm-account-suite #main-body textarea.form-control{
    min-height:48px!important;
    padding:10px 14px!important;
    border:1px solid #dbe3ee!important;
    border-radius:14px!important;
    background:#f8fafc!important;
    color:#172033!important;
    box-shadow:none!important;
    font-size:12px!important;
    transition:.2s ease!important;
}

body.crm-account-suite #main-body textarea.form-control{
    min-height:110px!important;
}

body.crm-account-suite #main-body input.form-control:focus,
body.crm-account-suite #main-body select.form-control:focus,
body.crm-account-suite #main-body textarea.form-control:focus{
    border-color:#60a5fa!important;
    background:#fff!important;
    box-shadow:0 0 0 4px rgba(37,99,235,.10)!important;
}

body.crm-account-suite #main-body .form-group{
    margin-bottom:17px!important;
}

/* ---------- دکمه‌ها ---------- */

body.crm-account-suite #main-body .btn{
    min-height:43px;
    padding:9px 16px;
    border-radius:13px!important;
    font-size:11px;
    font-weight:900;
    transition:.22s ease;
}

body.crm-account-suite #main-body .btn-primary{
    border:0!important;
    color:#fff!important;
    background:linear-gradient(135deg,#2563eb,#0284c7)!important;
    box-shadow:0 8px 20px rgba(37,99,235,.22);
}

body.crm-account-suite #main-body .btn-primary:hover{
    color:#fff!important;
    transform:translateY(-2px);
    box-shadow:0 12px 26px rgba(37,99,235,.30);
}

body.crm-account-suite #main-body .btn-danger{
    border:0!important;
    color:#dc2626!important;
    background:#fff1f2!important;
}

body.crm-account-suite #main-body .btn-danger:hover{
    color:#fff!important;
    background:linear-gradient(135deg,#dc2626,#ef4444)!important;
}

/* ---------- جدول‌ها ---------- */

body.crm-account-suite #main-body .table-responsive{
    overflow:hidden;
    border:1px solid #e8edf5;
    border-radius:19px;
    background:#fff;
}

body.crm-account-suite #main-body table{
    margin-bottom:0!important;
    color:#334155;
}

body.crm-account-suite #main-body table thead th{
    padding:14px 13px!important;
    border:0!important;
    border-bottom:1px solid #e5eaf2!important;
    color:#334155!important;
    background:linear-gradient(135deg,#f8fafc,#eff6ff)!important;
    font-size:11px!important;
    font-weight:950!important;
    vertical-align:middle!important;
}

body.crm-account-suite #main-body table tbody td{
    padding:13px!important;
    border-color:#edf2f7!important;
    font-size:11px!important;
    vertical-align:middle!important;
}

body.crm-account-suite #main-body table tbody tr{
    transition:.18s ease;
}

body.crm-account-suite #main-body table tbody tr:hover{
    background:#f8fbff!important;
}

/* ---------- هشدارها ---------- */

body.crm-account-suite #main-body .alert{
    border:0!important;
    border-radius:16px!important;
    padding:14px 17px!important;
    box-shadow:0 8px 22px rgba(15,23,42,.06);
}

body.crm-account-suite #main-body .alert-success{
    color:#047857!important;
    background:#ecfdf5!important;
}

body.crm-account-suite #main-body .alert-danger{
    color:#b91c1c!important;
    background:#fff1f2!important;
}

body.crm-account-suite #main-body .alert-info{
    color:#0369a1!important;
    background:#eff6ff!important;
}

/* ---------- Pagination ---------- */

body.crm-account-suite #main-body .pagination{
    gap:5px;
}

body.crm-account-suite #main-body .page-link{
    min-width:38px;
    min-height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid #e2e8f0!important;
    border-radius:11px!important;
    color:#475569!important;
    background:#fff!important;
}

body.crm-account-suite #main-body .page-item.active .page-link{
    border-color:transparent!important;
    color:#fff!important;
    background:linear-gradient(135deg,#2563eb,#0284c7)!important;
}

/* =========================================================
   ACCOUNT DROPDOWN
   ========================================================= */

.crm-profile-container{
    z-index:1060;
}

.crm-profile-trigger{
    overflow:hidden;
}

.crm-profile-menu{
    max-height:calc(100vh - 95px);
    overflow-y:auto!important;
    scrollbar-width:thin;
    scrollbar-color:#bfdbfe transparent;
}

.crm-profile-menu::-webkit-scrollbar{
    width:5px;
}

.crm-profile-menu::-webkit-scrollbar-thumb{
    border-radius:20px;
    background:#bfdbfe;
}

.crm-profile-menu-head{
    position:relative;
    overflow:hidden;
}

.crm-profile-menu-head:after{
    content:"";
    position:absolute;
    width:100px;
    height:100px;
    left:-40px;
    bottom:-60px;
    border:15px solid rgba(255,255,255,.08);
    border-radius:50%;
}

.crm-profile-menu-links{
    display:grid;
    grid-template-columns:1fr;
    gap:3px;
}

.crm-profile-menu-links > a{
    position:relative;
    overflow:hidden;
}

.crm-profile-menu-links > a:after{
    content:"";
    position:absolute;
    right:0;
    top:20%;
    bottom:20%;
    width:3px;
    border-radius:10px;
    background:linear-gradient(#2563eb,#06b6d4);
    opacity:0;
    transform:scaleY(.4);
    transition:.2s ease;
}

.crm-profile-menu-links > a:hover:after{
    opacity:1;
    transform:scaleY(1);
}

.crm-profile-menu-links > a.crm-current-account-link{
    color:#1d4ed8!important;
    background:linear-gradient(135deg,#eff6ff,#e0f2fe)!important;
}

.crm-profile-menu-links > a.crm-current-account-link:after{
    opacity:1;
    transform:scaleY(1);
}

.crm-profile-menu-links > a.crm-current-account-link .crm-profile-item-icon{
    color:#fff;
    background:linear-gradient(135deg,#2563eb,#0ea5e9);
}

/* ---------- آیکون معرفی خودکار ---------- */

.crm-auto-page-header{
    display:none;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width:991px){

    body.crm-account-suite #main-body{
        padding-top:16px!important;
    }

    body.crm-account-suite #main-body > .container{
        padding-left:12px!important;
        padding-right:12px!important;
    }

    .crm-account-page-intro{
        padding:21px;
        border-radius:22px;
    }

    .crm-account-page-intro-badge{
        display:none;
    }
}

@media (max-width:767px){

    .crm-account-page-intro{
        margin-bottom:17px;
        padding:18px;
    }

    .crm-account-page-intro-content{
        align-items:flex-start;
        gap:12px;
    }

    .crm-account-page-intro-icon{
        width:52px;
        height:52px;
        flex-basis:52px;
        border-radius:17px;
    }

    .crm-account-page-intro-icon svg{
        width:25px;
        height:25px;
    }

    .crm-account-page-intro h1{
        font-size:18px!important;
    }

    .crm-account-page-intro p{
        font-size:10px;
    }

    body.crm-account-suite #main-body .card{
        border-radius:19px!important;
    }

    body.crm-account-suite #main-body .card-header{
        padding:15px!important;
    }

    body.crm-account-suite #main-body .card-body{
        padding:15px!important;
    }

    body.crm-account-suite #main-body .table-responsive{
        overflow-x:auto!important;
        border-radius:15px;
    }

    body.crm-account-suite #main-body table{
        min-width:700px;
    }

    body.crm-account-suite #main-body .btn{
        min-height:44px;
    }

    .crm-profile-menu-links > a{
        min-height:57px;
    }

    .crm-profile-menu-links small{
        line-height:1.55;
    }
}
