@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');

/* پوسته تمام‌صفحه پنل مشتری */
html, body.cpm-app-body {
    margin: 0;
    padding: 0;
    background: var(--cpm-light);
    font-family: 'Vazirmatn', sans-serif;
    min-height: 100vh;
}
.cpm-app-topbar {
    background: var(--cpm-navy);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--cpm-gold);
}
.cpm-app-topbar img { max-height: 40px; display: block; }
.cpm-app-logo span {
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
}

.cpm-app-user { display: flex; align-items: center; gap: 16px; }
.cpm-app-username { color: #ffffff; font-size: 13px; opacity: .9; }
.cpm-app-logout {
    color: var(--cpm-gold);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--cpm-gold);
    padding: 5px 14px;
    border-radius: 20px;
    transition: all .2s;
}
.cpm-app-logout:hover { background: var(--cpm-gold); color: var(--cpm-navy); }

:root {
    --cpm-navy:  #002147;
    --cpm-gold:  #D4AF37;
    --cpm-light: #F2F2F2;
    --cpm-white: #ffffff;
    --cpm-success: #28a745;
    --cpm-danger:  #dc3545;
    --cpm-radius: 12px;
    --cpm-shadow: 0 4px 24px rgba(0,33,71,.10);
}

.cpm-client-wrap * { font-family: 'Vazirmatn', sans-serif; box-sizing: border-box; }
.cpm-client-wrap { direction: rtl; max-width: 900px; margin: 0 auto; padding: 20px; }

/* هدر */
.cpm-client-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; background: var(--cpm-navy); border-radius: var(--cpm-radius); color: white; margin-bottom: 24px; }
.cpm-client-header h2 { margin: 0; font-size: 1.3rem; }
.cpm-client-welcome p { margin: 4px 0 0 0; opacity: .7; font-size: 13px; }
.cpm-back-btn { color: var(--cpm-gold); text-decoration: none; font-weight: 700; font-size: 14px; }

/* دکمه‌ها */
.cpm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 22px; border-radius: 8px; border: none; cursor: pointer; font-family: 'Vazirmatn', sans-serif; font-size: 14px; font-weight: 700; transition: all .2s; text-decoration: none; }
.cpm-btn-primary { background: var(--cpm-navy); color: white; }
.cpm-btn-primary:hover { background: #003580; }
.cpm-btn-sm { padding: 7px 16px; font-size: 13px; }
.cpm-btn-outline { background: transparent; border: 2px solid rgba(255,255,255,.5); color: white; }
.cpm-btn-outline:hover { background: rgba(255,255,255,.1); }
.cpm-btn-full { width: 100%; margin-top: 12px; }

/* لاگین */
.cpm-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.cpm-login-box { background: white; border-radius: var(--cpm-radius); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--cpm-shadow); border-top: 4px solid var(--cpm-gold); }
.cpm-login-logo { text-align: center; margin-bottom: 28px; }
.cpm-login-logo h2 { color: var(--cpm-navy); }
.cpm-form-group { margin-bottom: 16px; }
.cpm-form-group label { display: block; font-weight: 700; color: var(--cpm-navy); margin-bottom: 8px; font-size: 14px; }
.cpm-input { width: 100%; padding: 11px 14px; border: 2px solid #ddd; border-radius: 8px; font-family: 'Vazirmatn', sans-serif; font-size: 14px; direction: rtl; transition: border .2s; }
.cpm-input:focus { outline: none; border-color: var(--cpm-navy); }
.cpm-login-footer { text-align: center; margin-top: 16px; font-size: 13px; color: #888; }
.cpm-login-footer a { color: var(--cpm-navy); }
.cpm-alert-error { background:#f8d7da; color:#721c24; padding:12px; border-radius:8px; margin-bottom:16px; font-size:13px; }

/* درخواست پروژه */
.cpm-request-section { background: white; border-radius: var(--cpm-radius); padding: 20px; margin-bottom: 24px; box-shadow: var(--cpm-shadow); }
.cpm-request-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid #eee; }

/* گرید پروژه‌ها */
.cpm-projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 18px; }
.cpm-project-card { background: white; border-radius: var(--cpm-radius); padding: 20px; box-shadow: var(--cpm-shadow); border-top: 4px solid var(--cpm-navy); }
.cpm-project-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cpm-project-card h3 { color: var(--cpm-navy); font-size: 16px; margin: 0 0 12px 0; }
.cpm-model-tag { font-size: 11px; background: var(--cpm-light); color: #555; padding: 4px 10px; border-radius: 20px; }
.cpm-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.cpm-badge-approved { background:#d4edda; color:#155724; }
.cpm-badge-pending  { background:#fff3cd; color:#856404; }
.cpm-badge-rejected { background:#f8d7da; color:#721c24; }
.cpm-pending-msg { color: #888; font-size: 13px; text-align: center; padding: 12px 0; }
.cpm-date { color: #aaa; font-size: 12px; display: block; margin-top: 10px; }
.cpm-empty-state { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: #888; }

/* پیشرفت */
.cpm-progress-section { background: white; border-radius: var(--cpm-radius); padding: 20px; margin-bottom: 24px; box-shadow: var(--cpm-shadow); }
.cpm-progress-big { padding: 24px; }
.cpm-progress-label { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--cpm-navy); }
.cpm-progress-track { background: var(--cpm-light); border-radius: 30px; height: 16px; overflow: hidden; }
.cpm-progress-fill { background: linear-gradient(90deg, var(--cpm-navy), var(--cpm-gold)); height: 100%; border-radius: 30px; transition: width .6s ease; }

/* تایم‌لاین */
.cpm-steps-timeline { display: flex; flex-direction: column; gap: 0; }
.cpm-timeline-item { display: flex; gap: 0; position: relative; }
.cpm-timeline-item::before { content:''; position:absolute; right: 18px; top: 40px; bottom: -12px; width: 2px; background: #ddd; z-index: 0; }
.cpm-timeline-item:last-child::before { display: none; }
.cpm-timeline-dot { width: 38px; height: 38px; border-radius: 50%; background: var(--cpm-navy); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; z-index: 1; margin-top: 20px; }
.cpm-timeline-item.cpm-status-completed .cpm-timeline-dot { background: var(--cpm-success); }
.cpm-timeline-item.cpm-status-problem .cpm-timeline-dot,
.cpm-timeline-item.cpm-status-client_action .cpm-timeline-dot { background: var(--cpm-danger); }
.cpm-timeline-item.cpm-status-in_progress .cpm-timeline-dot { background: var(--cpm-gold); color: var(--cpm-navy); }

.cpm-timeline-content { flex: 1; background: white; border-radius: var(--cpm-radius); padding: 20px; margin: 12px 12px 12px 0; box-shadow: var(--cpm-shadow); }
.cpm-timeline-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.cpm-timeline-header h4 { margin: 0; color: var(--cpm-navy); font-size: 15px; }
.cpm-step-desc { color: #666; font-size: 13px; margin: 0 0 12px 0; }
.cpm-responsible-row { font-size: 13px; color: #555; margin-bottom: 12px; }

/* وضعیت */
.cpm-status-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.cpm-status-pending       { background:#fff3cd; color:#856404; }
.cpm-status-in_progress   { background:#cce5ff; color:#004085; }
.cpm-status-completed     { background:#d4edda; color:#155724; }
.cpm-status-client_action { background:#fde2e2; color:#721c24; }
.cpm-status-problem       { background:#f8d7da; color:#721c24; }

/* یادداشت کارشناس */
.cpm-admin-note-box { background: #fffde7; border-right: 3px solid var(--cpm-gold); padding: 12px 16px; border-radius: 6px; margin: 12px 0; }
.cpm-admin-note-box strong { font-size: 13px; color: #666; display: block; margin-bottom: 6px; }
.cpm-admin-note-box p { margin: 0; font-size: 14px; color: #333; }

/* یادداشت مشتری */
.cpm-client-note-section { margin: 12px 0; }
.cpm-client-note-section label { font-size: 13px; font-weight: 700; color: #555; display: block; margin-bottom: 6px; }
textarea.cpm-input { resize: vertical; }

/* آپلود */
.cpm-upload-section { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #ddd; }
.cpm-upload-section label { font-size: 13px; font-weight: 700; color: #555; display: block; margin-bottom: 8px; }
.cpm-file-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cpm-upload-result { font-size: 13px; color: var(--cpm-success); }

/* تایید */
.cpm-confirm-section { margin-top: 14px; }
.cpm-confirmed-msg { background: #d4edda; color: #155724; padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 700; }

/* فایل‌ها */
.cpm-files-list { margin-top: 12px; border-top: 1px solid #f0f0f0; padding-top: 12px; }
.cpm-file-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.cpm-file-item a { color: var(--cpm-navy); text-decoration: none; font-weight: 600; }

/* تاریخچه فعالیت در پنل مشتری */
.cpm-client-log-section { background: white; border-radius: var(--cpm-radius); padding: 20px; margin-top: 24px; box-shadow: var(--cpm-shadow); }
.cpm-client-log-section h3 { color: var(--cpm-navy); margin-top: 0; font-size: 16px; }
.cpm-client-log-list { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.cpm-client-log-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--cpm-light); border-radius: 8px; }
.cpm-client-log-item .cpm-log-content p { margin: 0; font-size: 13px; color: #333; }
.cpm-client-log-item .cpm-log-content small { color: #999; font-size: 11px; }
.cpm-empty-log { color: #999; font-size: 13px; text-align: center; padding: 16px 0; }


/* ریسپانسیو */
@media (max-width: 600px) {
    .cpm-client-wrap { padding: 12px; }
    .cpm-client-header { flex-direction: column; gap: 12px; text-align: center; padding: 16px; }
    .cpm-client-header h2 { font-size: 1.1rem; }
    .cpm-client-welcome h2 span.cpm-username {
    color: var(--cpm-gold);
    font-weight: 800;
}
    .cpm-projects-grid { grid-template-columns: 1fr; }
    .cpm-timeline-content { margin: 8px 0 8px 0; padding: 14px; }

    /* نوار بالایی تمام‌صفحه */
    .cpm-app-topbar { padding: 10px 16px; }
    .cpm-app-topbar img { max-height: 32px; }
    .cpm-app-logo span { font-size: 15px; }

    /* فرم لاگین */
    .cpm-login-box { padding: 24px 20px; width: 90%; }

    /* تایم‌لاین مراحل */
    .cpm-timeline-item::before { right: 14px; }
    .cpm-timeline-dot { width: 32px; height: 32px; font-size: 12px; margin-top: 14px; }
    .cpm-timeline-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .cpm-timeline-header h4 { font-size: 14px; }

    /* آپلود فایل */
    .cpm-file-upload { flex-direction: column; align-items: stretch; gap: 8px; }
    .cpm-file-upload .cpm-upload-btn { width: 100%; }
    .cpm-file-input { width: 100%; }

    /* دکمه تایید مرحله */
    .cpm-confirm-section .cpm-btn { width: 100%; justify-content: center; }

    /* تاریخچه فعالیت */
    .cpm-client-log-section { padding: 14px; }
    .cpm-client-log-item { flex-direction: row; align-items: flex-start; }

    /* فرم درخواست پروژه */
    .cpm-request-section { padding: 14px; }

    .cpm-app-topbar { flex-wrap: wrap; gap: 8px; }
    .cpm-app-username { display: none; }
}

/* wrapper برای حالت داخل قالب سایت */
.cpm-page-wrap {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}
.cpm-btn-navy {
    background: var(--cpm-navy);
    color: white;
    border: none;
}
.cpm-btn-navy:hover {
    background: #003580;
    color: white;
}
/* مرحله قفل شده برای مشتری */
.cpm-step-locked { opacity: .6; background: #f9f9f9; }
.cpm-locked-badge { 
    background: #e9ecef; 
    color: #6c757d; 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 700; 
}
.cpm-locked-msg { 
    color: #999; 
    font-size: 13px; 
    font-style: italic; 
    padding: 12px 0; 
    text-align: center; 
}
/* پروفایل کاربری */
.cpm-profile-card {
    background: white;
    border-radius: var(--cpm-radius);
    padding: 28px;
    box-shadow: var(--cpm-shadow);
    max-width: 700px;
    margin: 0 auto;
}
.cpm-profile-avatar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--cpm-light);
}
.cpm-profile-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    border: 3px solid var(--cpm-gold);
}
.cpm-profile-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cpm-profile-name strong, .cpm-profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--cpm-navy);
}
.cpm-profile-name small {
    font-size: 13px;
    color: #888;
}
.cpm-profile-row {
    display: flex;
    gap: 16px;
    margin-bottom: 4px;
}
.cpm-profile-row .cpm-form-group { flex: 1; }
.cpm-form-group { margin-bottom: 16px; }
.cpm-form-group label {
    display: block;
    font-weight: 700;
    color: var(--cpm-navy);
    margin-bottom: 6px;
    font-size: 14px;
}

/* دکمه‌های هدر */
.cpm-header-actions { display: flex; gap: 8px; align-items: center; }
.cpm-btn-outline-navy {
    background: transparent;
    border: 2px solid rgba(255,255,255,.6);
    color: white;
}
.cpm-btn-outline-navy:hover { background: rgba(255,255,255,.1); color: white; }

/* ریسپانسیو پروفایل */
@media (max-width: 600px) {
    .cpm-profile-row { flex-direction: column; gap: 0; }
    .cpm-header-actions { flex-direction: row; gap: 6px; }
    .cpm-profile-card { padding: 16px; }
}
/* دکمه پروفایل */
.cpm-btn-profile {
    background: var(--cpm-gold);
    color: var(--cpm-navy);
    font-weight: 700;
    border: none;
}
.cpm-btn-profile:hover {
    background: #c49b2d;
    color: var(--cpm-navy);
}
/* حذف زیرمنوی WooCommerce از حساب کاربری */
.woocommerce-MyAccount-navigation,
ul.sub-menu li a[href*="my-account"],
ul.sub-menu li a[href*="customer-logout"],
ul.sub-menu li a[href*="wc-logout"],
.nav-menu .menu-item a[href*="customer-logout"] {
    display: none !important;
}

/* مخفی کردن کل زیرمنوی آیتم حساب کاربری */
.menu-item a[href*="my-account"] ~ ul.sub-menu,
.menu-item a[href*="my-projects"] ~ ul.sub-menu {
    display: none !important;
}
