/* ═══════════════════════════════════════════════════
   Projects Manager — مدیریت پروژه‌های مشتری
═══════════════════════════════════════════════════ */
.pm-wrap {
    padding: 24px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--text-main, #1e293b);
    min-height: 100%;
    background: var(--bg-page, #f8fafc);
}

/* ── هدر ── */
.pm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.pm-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-main, #1e293b);
}
.pm-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* ── دکمه‌ها ── */
.pm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    transition: all .18s;
    white-space: nowrap;
}
.pm-btn--primary {
    background: #6366f1;
    color: #fff;
}
.pm-btn--primary:hover { background: #4f46e5; }
.pm-btn--ghost {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.pm-btn--ghost:hover { background: #f1f5f9; }
.pm-btn--activate {
    background: #059669;
    color: #fff;
}
.pm-btn--activate:hover { background: #047857; }

/* ── فیلترها ── */
.pm-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.pm-select {
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: #374151;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}
.pm-select:focus { border-color: #6366f1; }
.pm-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s;
}
.pm-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px #6366f120; }
textarea.pm-input { resize: vertical; min-height: 64px; }
.pm-count {
    font-size: 12px;
    color: #94a3b8;
    margin-right: auto;
}

/* ── جدول ── */
.pm-table-wrap {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.pm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.pm-table thead th {
    background: #f8fafc;
    padding: 10px 14px;
    text-align: right;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    border-bottom: 1px solid #e2e8f0;
}
.pm-tr {
    cursor: pointer;
    transition: background .12s;
    border-bottom: 1px solid #f1f5f9;
}
.pm-tr:hover { background: #f8fafc; }
.pm-tr--running {
    background: #ecfdf5 !important;
    border-right: 3px solid #10b981;
}
.pm-tr--running:hover { background: #d1fae5 !important; }
.pm-table td { padding: 10px 14px; vertical-align: middle; }

.pm-logo-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.pm-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #6366f120;
    color: #6366f1;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}
.pm-row-title { display: flex; align-items: center; gap: 8px; }
.pm-row-desc { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.pm-running-badge {
    font-size: 10px;
    background: #10b981;
    color: #fff;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}
.pm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── دکمه‌های عملیات ── */
.pm-actions { display: flex; gap: 6px; align-items: center; }
.pm-act-btn {
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.pm-act-btn:hover { background: #f1f5f9; }
.pm-act-btn--activate {
    background: #059669;
    color: #fff;
    border-color: #059669;
    font-weight: 600;
}
.pm-act-btn--activate:hover { background: #047857; }
.pm-act-btn--del { color: #ef4444; border-color: #fecaca; }
.pm-act-btn--del:hover { background: #fef2f2; }

/* ── خالی / بارگذاری / خطا ── */
.pm-loading, .pm-empty, .pm-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: #64748b;
    gap: 12px;
}
.pm-error { color: #ef4444; }

/* ══════════════════════════════════════════════════
   مدال فرم
══════════════════════════════════════════════════ */
.pm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.pm-modal {
    background: #fff;
    border-radius: 14px;
    width: min(900px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: pmSlideIn .2s ease;
}
@keyframes pmSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
.pm-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.pm-form-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}
.pm-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background .12s;
}
.pm-close-btn:hover { background: #e2e8f0; }

.pm-form-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.pm-form-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 640px) {
    .pm-form-cols { grid-template-columns: 1fr; }
}
.pm-form-col { display: flex; flex-direction: column; gap: 14px; }
.pm-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}
.pm-field { display: flex; flex-direction: column; gap: 5px; }
.pm-field label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.pm-req { color: #ef4444; }

.pm-form-footer {
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f8fafc;
    flex-wrap: wrap;
}
.pm-form-error {
    font-size: 12px;
    color: #ef4444;
    background: #fef2f2;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    flex: 1;
}
