﻿/* ============================================================
   pay2-salary.css  —  Master Karkart PAY2 Shared Stylesheet
   نسخه: v6.0  |  تمام تب‌های حقوق و دستمزد از این فایل استفاده می‌کنند
   ============================================================ */


/* ════════════════════════════════════════════════════════════
   ۱. متغیرهای رنگ و اندازه (CSS Variables)
   ════════════════════════════════════════════════════════════ */
:root {
    /* رنگ اصلی */
    --p2-primary: #2563eb;
    --p2-primary-hover: #1d4ed8;
    --p2-primary-dark: #1e3a8a;
    --p2-primary-light: #eff6ff;
    --p2-primary-border: #93c5fd;
    /* پس‌زمینه */
    --p2-bg-main: #f8fafc;
    --p2-bg-white: #ffffff;
    --p2-bg-hover: #f1f5f9;
    /* متن */
    --p2-text-main: #1e293b;
    --p2-text-muted: #64748b;
    --p2-text-light: #94a3b8;
    /* خطوط */
    --p2-border: #e2e8f0;
    --p2-border-light: #f1f5f9;
    /* وضعیت‌ها */
    --p2-success-bg: #ecfdf5;
    --p2-success-text: #059669;
    --p2-success-border: #a7f3d0;
    --p2-warning-bg: #fffbeb;
    --p2-warning-text: #d97706;
    --p2-warning-border: #fde68a;
    --p2-danger-bg: #fef2f2;
    --p2-danger-text: #dc2626;
    --p2-danger-border: #fecaca;
    --p2-info-bg: #f0f9ff;
    --p2-info-text: #0284c7;
    --p2-info-border: #bae6fd;
    /* سایه */
    --p2-shadow-sm: 0 1px 4px rgba(15, 23, 42, 0.04);
    --p2-shadow-md: 0 2px 15px rgba(15, 23, 42, 0.05);
    --p2-shadow-lg: 0 8px 28px rgba(15, 23, 42, 0.10);
    --p2-shadow-xl: 0 16px 48px rgba(15, 23, 42, 0.14);
    /* شعاع */
    --p2-radius-sm: 8px;
    --p2-radius-md: 12px;
    --p2-radius-lg: 16px;
    --p2-radius-xl: 20px;
    /* فونت */
    --p2-font: 'Vazirmatn', 'IRANYekan', 'IRANSans', Tahoma, Arial, sans-serif;
    /* ارتفاع input ها */
    --p2-input-h: 42px;
    /* عرض سایدبار */
    --p2-sidebar-w: 260px;
    --p2-header-h: 64px;
}


/* ════════════════════════════════════════════════════════════
   ۲. پوسته اصلی اپلیکیشن (App Shell)
   ════════════════════════════════════════════════════════════ */

/* ریست پایه */
.pay2-app *,
.pay2-app *::before,
.pay2-app *::after {
    box-sizing: border-box;
}

/* کانتینر کل صفحه */
.pay2-app {
    font-family: var(--p2-font);
    background-color: var(--p2-bg-main);
    color: var(--p2-text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ناحیه اصلی (کنار سایدبار) */
.pay2-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* هدر بالای صفحه */
.pay2-header {
    height: var(--p2-header-h);
    min-height: var(--p2-header-h);
    background-color: var(--p2-bg-white);
    border-bottom: 1px solid var(--p2-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 5;
    flex-shrink: 0;
}

.pay2-header-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--p2-text-main);
}

/* محتوای اصلی */
.pay2-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
    background: var(--p2-bg-main);
}

    .pay2-content::-webkit-scrollbar {
        width: 5px;
    }

    .pay2-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .pay2-content::-webkit-scrollbar-thumb {
        background: var(--p2-border);
        border-radius: 99px;
    }


/* ════════════════════════════════════════════════════════════
   ۳. سایدبار (Sidebar)
   ════════════════════════════════════════════════════════════ */

.pay2-sidebar {
    width: var(--p2-sidebar-w);
    min-width: var(--p2-sidebar-w);
    background-color: var(--p2-bg-white);
    border-left: 1px solid var(--p2-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
}

/* لوگو / برند */
.pay2-brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--p2-border-light);
    flex-shrink: 0;
}

.pay2-brand-icon {
    width: 40px;
    height: 40px;
    background-color: var(--p2-primary);
    color: white;
    border-radius: var(--p2-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}

.pay2-brand-name {
    font-weight: 800;
    font-size: 15px;
    color: var(--p2-text-main);
    line-height: 1.2;
}

.pay2-brand-version {
    font-size: 11px;
    color: var(--p2-text-muted);
    margin-top: 2px;
}

/* کارت دوره فعال */
.pay2-period-card {
    background-color: var(--p2-bg-main);
    border-radius: var(--p2-radius-md);
    margin: 12px 14px;
    padding: 10px 14px;
    border: 1px solid var(--p2-border-light);
    flex-shrink: 0;
}

.pay2-period-label {
    font-size: 11px;
    color: var(--p2-text-muted);
    margin-bottom: 4px;
}

.pay2-period-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pay2-period-value {
    font-weight: 800;
    color: var(--p2-primary);
    font-size: 15px;
}

.pay2-period-badge {
    background-color: var(--p2-primary-light);
    color: var(--p2-primary);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

/* منوی ناوبری */
.pay2-menu {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px;
    list-style: none;
    margin: 0;
}

    .pay2-menu::-webkit-scrollbar {
        display: none;
    }

.pay2-nav-item {
    display: flex;
    align-items: center;
    padding: 13px 16px;
    margin: 3px 0;
    border-radius: var(--p2-radius-md);
    color: var(--p2-text-muted);
    cursor: pointer;
    transition: all 0.18s ease;
    font-weight: 600;
    font-size: 13.5px;
    gap: 10px;
    user-select: none;
}

    .pay2-nav-item i {
        font-size: 1.05rem;
        flex-shrink: 0;
    }

    .pay2-nav-item:hover {
        background-color: var(--p2-bg-main);
        color: var(--p2-text-main);
    }

    .pay2-nav-item.active {
        background-color: var(--p2-primary-light);
        color: var(--p2-primary);
        font-weight: 700;
    }

/* فوتر سایدبار */
.pay2-sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--p2-border-light);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pay2-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 17px;
    background-color: var(--p2-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--p2-text-muted);
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
}

.pay2-user-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--p2-text-main);
}

.pay2-user-role {
    font-size: 11px;
    color: var(--p2-text-muted);
}


/* ════════════════════════════════════════════════════════════
   ۴. سرچ‌باکس هدر
   ════════════════════════════════════════════════════════════ */

.pay2-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    .pay2-search-wrapper i {
        position: absolute;
        right: 12px;
        color: var(--p2-text-muted);
        pointer-events: none;
        font-size: 14px;
    }

.pay2-search-input {
    background-color: var(--p2-bg-main);
    border: 1px solid var(--p2-border);
    border-radius: var(--p2-radius-md);
    padding: 8px 36px 8px 14px;
    width: 240px;
    outline: none;
    font-size: 13px;
    font-family: var(--p2-font);
    color: var(--p2-text-main);
    transition: all 0.2s;
}

    .pay2-search-input:focus {
        border-color: var(--p2-primary-border);
        background-color: var(--p2-bg-white);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    }

    .pay2-search-input::placeholder {
        color: var(--p2-text-light);
    }


/* ════════════════════════════════════════════════════════════
   ۵. انیمیشن ورودی تب
   ════════════════════════════════════════════════════════════ */

@keyframes pay2FadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pay2-tab-container {
    animation: pay2FadeSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    height: 100%;
    width: 100%;
}


/* ════════════════════════════════════════════════════════════
   ۶. اعلان Toast
   ════════════════════════════════════════════════════════════ */

.pay2-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 12px 22px;
    border-radius: var(--p2-radius-lg);
    z-index: 9999;
    box-shadow: var(--p2-shadow-xl);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--p2-font);
    white-space: nowrap;
    pointer-events: none;
}

    .pay2-toast.success {
        background: var(--p2-success-text);
    }

    .pay2-toast.danger {
        background: var(--p2-danger-text);
    }

    .pay2-toast.warning {
        background: var(--p2-warning-text);
    }


/* ════════════════════════════════════════════════════════════
   ۷. کارت‌ها (Cards)
   ════════════════════════════════════════════════════════════ */

.p2-card {
    background: var(--p2-bg-white);
    border: 1px solid var(--p2-border-light);
    border-radius: var(--p2-radius-lg);
    padding: 22px;
    box-shadow: var(--p2-shadow-md);
}

/* هدر داخل کارت */
.p2-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--p2-border-light);
}

    .p2-card-header h5,
    .p2-card-header .p2-card-title {
        margin: 0;
        font-size: 15px;
        font-weight: 800;
        color: var(--p2-text-main);
    }

    .p2-card-header .p2-card-actions {
        display: flex;
        gap: 8px;
        align-items: center;
    }

/* کارت ثانویه (زیر بخش) */
.p2-sub-card {
    background: var(--p2-bg-main);
    border: 1px solid var(--p2-border-light);
    border-radius: var(--p2-radius-md);
    padding: 16px;
    margin-top: 16px;
}

.p2-sub-card-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--p2-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* backward compat — نام قدیمی */
.card-custom {
    background: var(--p2-bg-white);
    border: 1px solid var(--p2-border-light);
    border-radius: var(--p2-radius-lg);
    padding: 22px;
    box-shadow: var(--p2-shadow-md);
}

.pay2-sub-card {
    background: var(--p2-bg-main);
    border: 1px solid var(--p2-border-light);
    border-radius: var(--p2-radius-md);
    padding: 16px;
    margin-top: 16px;
}

.pay2-sub-card-title {
    font-weight: 800;
    color: var(--p2-primary);
    margin-bottom: 14px;
}

.pay2-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

    .pay2-card-header h5 {
        margin: 0;
        font-size: 15px;
        font-weight: 800;
    }

.pay2-section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--p2-text-main);
    margin-bottom: 4px;
}

.pay2-section-subtitle {
    color: var(--p2-text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}


/* ════════════════════════════════════════════════════════════
   ۸. فیلدهای فرم (Form Fields)
   ════════════════════════════════════════════════════════════ */

.form-field {
    display: flex;
    flex-direction: column;
}

    .form-field label {
        display: block;
        font-size: 12.5px;
        font-weight: 700;
        color: var(--p2-text-main);
        margin-bottom: 6px;
    }

    .form-field .field-hint {
        font-size: 11.5px;
        color: var(--p2-text-muted);
        margin-top: 5px;
    }

    .form-field .field-error {
        font-size: 11.5px;
        color: var(--p2-danger-text);
        margin-top: 5px;
        font-weight: 600;
    }

/* ─── Input / Select / Textarea ─── */
.pay2-input,
.pay2-select,
.pay2-textarea,
.pay2-wpf-select {
    width: 100%;
    border: 1px solid var(--p2-border);
    border-radius: 10px;
    background: var(--p2-bg-main);
    color: var(--p2-text-main);
    outline: none;
    font-size: 13px;
    font-family: var(--p2-font);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.pay2-input,
.pay2-select,
.pay2-wpf-select {
    height: var(--p2-input-h);
    padding: 0 12px;
    display: flex;
    align-items: center;
}

.pay2-textarea {
    min-height: 80px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.6;
}

    .pay2-input:hover,
    .pay2-select:hover,
    .pay2-textarea:hover,
    .pay2-wpf-select:hover {
        border-color: #cbd5e1;
    }

    .pay2-input:focus,
    .pay2-select:focus,
    .pay2-textarea:focus,
    .pay2-wpf-select:focus {
        background: var(--p2-bg-white);
        border-color: var(--p2-primary-border);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    }

    .pay2-input:disabled,
    .pay2-select:disabled,
    .pay2-textarea:disabled,
    .pay2-wpf-select:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        background: var(--p2-border-light);
    }

    .pay2-input.error,
    .pay2-select.error,
    .pay2-textarea.error {
        border-color: var(--p2-danger-text);
        box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
    }

.pay2-input::placeholder {
    color: var(--p2-text-light);
}

.pay2-textarea::placeholder {
    color: var(--p2-text-light);
}


/* ════════════════════════════════════════════════════════════
   ۹. گریدهای فرم (Form Grids)
   ════════════════════════════════════════════════════════════ */

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
}

/* یک فیلد که کل ستون رو بگیره */
.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-full {
    grid-column: 1 / -1;
}


/* ════════════════════════════════════════════════════════════
   ۱۰. چک‌باکس سفارشی (Custom Checkbox)
   ════════════════════════════════════════════════════════════ */
.pay2-wpf-checkbox-box {
    width: 100%;
    height: var(--p2-input-h);
    background: var(--p2-bg-main);
    border: 1px solid var(--p2-border);
    border-radius: 10px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}

    .pay2-wpf-checkbox-box:hover {
        border-color: #cbd5e1;
        background: var(--p2-bg-white);
    }

.pay2-wpf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: var(--p2-text-main);
    cursor: pointer;
    user-select: none;
    font-family: var(--p2-font);
    line-height: 1;
}

    .pay2-wpf-checkbox-label input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        position: relative; /* ← base برای ::after */
        top: 4px;
        width: 17px;
        height: 17px;
        min-width: 17px;
        flex-shrink: 0;
        margin: 0;
        margin-top: 1px; /* ← تراز با متن */
        padding: 0;
        cursor: pointer;
        border: 1.5px solid #94a3b8;
        border-radius: 5px; /* ← گرد شد */
        background: #ffffff;
        transition: all 0.15s;
    }

        .pay2-wpf-checkbox-label input[type="checkbox"]:checked {
            background: var(--p2-primary);
            border-color: var(--p2-primary);
        }

            /* تیک با border trick — نه content:"✓" که RTL مشکل داشت */
            .pay2-wpf-checkbox-label input[type="checkbox"]:checked::after {
                content: "";
                position: absolute;
                left: 4px;
                top: 1px;
                width: 6px;
                height: 10px;
                border: 2px solid white;
                border-top: none;
                border-left: none;
                transform: rotate(45deg);
            }

/* ════════════════════════════════════════════════════════════
   ۱۱. دراپ‌داون سفارشی (Custom Dropdown)
   ════════════════════════════════════════════════════════════ */

.pay2-dd {
    position: relative; /* ← منو نسبت به این مکان‌یابی می‌شود */
    width: 100%;
}

.pay2-dd-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--p2-text-main);
    margin-bottom: 6px;
}

.pay2-dd-button {
    width: 100%;
    height: var(--p2-input-h);
    background: var(--p2-bg-main);
    border: 1px solid var(--p2-border);
    border-radius: 10px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--p2-text-main);
    cursor: pointer;
    outline: none;
    font-family: var(--p2-font);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    text-align: right;
}

    .pay2-dd-button:hover {
        background: var(--p2-bg-white);
        border-color: #cbd5e1;
    }

    .pay2-dd-button:focus,
    .pay2-dd-button.open {
        background: var(--p2-bg-white);
        border-color: var(--p2-primary-border);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    }

/* ═══════════════════════════════════════════════
   Arrow نرم، گرد و دوستانه (بدون لبه تیز)
   ═══════════════════════════════════════════════ */

.pay2-dd-arrow {
    display: inline-block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-right: 8px;
    position: relative;
    top: 1px;
}

    .pay2-dd-arrow::before {
        content: '';
        position: absolute;
        width: 9px;
        height: 9px;
        border-right: 2.5px solid var(--p2-text-muted);
        border-bottom: 2.5px solid var(--p2-text-muted);
        border-radius: 1.7px; /* ← این باعث نرم شدن گوشه می‌شود */
        transform: rotate(45deg);
        top: 0px;
        right: 1px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

.pay2-dd-button:hover .pay2-dd-arrow::before {
    border-color: var(--p2-text-main);
}

.pay2-dd-button.open .pay2-dd-arrow::before {
    transform: rotate(225deg);
    border-color: var(--p2-primary);
}

.pay2-dd-button:focus .pay2-dd-arrow::before {
    border-color: var(--p2-primary);
}

.pay2-dd-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    background: var(--p2-bg-white);
    border: 1px solid var(--p2-border);
    border-radius: 10px;
    padding: 5px;
    z-index: 1000;
    box-shadow: var(--p2-shadow-lg);
    overflow: hidden;
}

.pay2-dd-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--p2-radius-sm);
    padding: 0 12px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--p2-text-main);
    cursor: pointer;
    font-family: var(--p2-font);
    transition: background 0.12s;
    gap: 8px;
}

    .pay2-dd-item:hover {
        background: var(--p2-primary-light);
        color: var(--p2-primary);
    }

    .pay2-dd-item.selected {
        background: var(--p2-primary-light);
        color: var(--p2-primary);
        font-weight: 800;
    }

        .pay2-dd-item.selected::after {
            content: "✓";
            margin-right: auto;
            margin-left: 4px;
            font-weight: 900;
        }


/* ════════════════════════════════════════════════════════════
   ۱۲. دکمه‌ها (Buttons)
   ════════════════════════════════════════════════════════════ */

/* ─── پایه مشترک ─── */
.p2-btn,
.btn-primary-pay2,
.btn-outline-pay2,
.btn-danger-pay2,
.btn-success-pay2,
.btn-ghost-pay2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: var(--p2-radius-md);
    min-height: 40px;
    padding: 11px 20px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--p2-font);
    cursor: pointer;
    outline: none;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
    line-height: 1.35;
    vertical-align: middle;
}


/* ─── Primary ─── */
.btn-primary-pay2 {
    background: var(--p2-primary);
    color: white;
    border-color: var(--p2-primary);
}

    .btn-primary-pay2:hover {
        background: var(--p2-primary-hover);
        border-color: var(--p2-primary-hover);
    }

    .btn-primary-pay2:active {
        background: var(--p2-primary-dark);
    }

    .btn-primary-pay2:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ─── Outline ─── */
.btn-outline-pay2 {
    background: transparent;
    color: var(--p2-text-main);
    border-color: var(--p2-border);
}

    .btn-outline-pay2:hover {
        background: var(--p2-primary-light);
        border-color: var(--p2-primary-border);
        color: var(--p2-primary);
    }

    .btn-outline-pay2:active {
        background: #dbeafe;
    }

    .btn-outline-pay2:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ─── Danger ─── */
.btn-danger-pay2 {
    background: var(--p2-danger-text);
    color: white;
    border-color: var(--p2-danger-text);
}

    .btn-danger-pay2:hover {
        background: #b91c1c;
        border-color: #b91c1c;
    }

    .btn-danger-pay2:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ─── Outline Danger ─── */
.btn-outline-danger-pay2 {
    background: transparent;
    color: var(--p2-danger-text);
    border-color: var(--p2-danger-border);
    border-radius: var(--p2-radius-md);
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--p2-font);
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-outline-danger-pay2:hover {
        background: var(--p2-danger-bg);
    }

/* ─── Success ─── */
.btn-success-pay2 {
    background: var(--p2-success-text);
    color: white;
    border-color: var(--p2-success-text);
}

    .btn-success-pay2:hover {
        background: #047857;
    }

    .btn-success-pay2:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ─── Ghost (بدون border) ─── */
.btn-ghost-pay2 {
    background: transparent;
    color: var(--p2-text-muted);
    border-color: transparent;
    padding: 8px 12px;
}

    .btn-ghost-pay2:hover {
        background: var(--p2-bg-main);
        color: var(--p2-text-main);
    }

/* ─── اندازه‌های مختلف ─── */
.p2-btn-sm, .btn-primary-pay2.sm, .btn-outline-pay2.sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--p2-radius-sm);
}

.p2-btn-lg, .btn-primary-pay2.lg, .btn-outline-pay2.lg {
    padding: 12px 24px;
    font-size: 14px;
}

/* ─── دکمه سفید روی پس‌زمینه آبی (داشبورد) ─── */
.btn-outline-white {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 9px 18px;
    border-radius: var(--p2-radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--p2-font);
    transition: all 0.15s;
}

    .btn-outline-white:hover {
        background: rgba(255,255,255,0.15);
    }


/* ════════════════════════════════════════════════════════════
   ۱۳. جدول (Tables)
   ════════════════════════════════════════════════════════════ */

.p2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .p2-table thead tr {
        background: var(--p2-bg-main);
    }

    .p2-table th {
        color: var(--p2-text-muted);
        font-weight: 700;
        font-size: 12px;
        text-transform: uppercase;
        padding: 11px 14px;
        border-bottom: 1px solid var(--p2-border);
        white-space: nowrap;
        text-align: right;
    }

    .p2-table td {
        padding: 11px 14px;
        border-bottom: 1px solid var(--p2-border-light);
        color: var(--p2-text-main);
        text-align: right;
    }

    .p2-table tbody tr {
        transition: background 0.12s;
    }

        .p2-table tbody tr:hover {
            background: var(--p2-bg-main);
        }

        .p2-table tbody tr:last-child td {
            border-bottom: none;
        }

        .p2-table tbody tr.selected {
            background: var(--p2-primary-light);
        }

/* backward compat */
.workshop-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .workshop-table th {
        color: var(--p2-text-muted);
        font-weight: 700;
        font-size: 12px;
        padding: 11px 14px;
        border-bottom: 1px solid var(--p2-border);
        background: var(--p2-bg-main);
        text-align: right;
    }

    .workshop-table td {
        padding: 11px 14px;
        border-bottom: 1px solid var(--p2-border-light);
        text-align: right;
    }

.workshop-row {
    cursor: pointer;
    transition: background 0.12s;
}

    .workshop-row:hover {
        background: var(--p2-bg-main);
    }

    .workshop-row.active {
        background: var(--p2-primary-light);
    }


/* ════════════════════════════════════════════════════════════
   ۱۴. بج‌ها (Badges)
   ════════════════════════════════════════════════════════════ */

.p2-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    font-family: var(--p2-font);
}

.p2-badge-success, .badge-success {
    background: var(--p2-success-bg);
    color: var(--p2-success-text);
    border: 1px solid var(--p2-success-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.p2-badge-warning, .badge-warning {
    background: var(--p2-warning-bg);
    color: var(--p2-warning-text);
    border: 1px solid var(--p2-warning-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.p2-badge-danger, .badge-error, .badge-danger {
    background: var(--p2-danger-bg);
    color: var(--p2-danger-text);
    border: 1px solid var(--p2-danger-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.p2-badge-primary, .badge-primary {
    background: var(--p2-primary-light);
    color: var(--p2-primary);
    border: 1px solid #bfdbfe;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.p2-badge-info, .badge-info {
    background: var(--p2-info-bg);
    color: var(--p2-info-text);
    border: 1px solid var(--p2-info-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.p2-badge-neutral {
    background: var(--p2-bg-main);
    color: var(--p2-text-muted);
    border: 1px solid var(--p2-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}


/* ════════════════════════════════════════════════════════════
   ۱۵. لی‌اوت دو پنل (Workshop / Master-Detail)
   ════════════════════════════════════════════════════════════ */

.pay2-two-panel {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    width: 100%;
    direction: ltr;
}

    .pay2-two-panel > * {
        direction: rtl;
    }

.pay2-two-panel-list {
    overflow: hidden;
    border-radius: var(--p2-radius-lg);
    border: 1px solid var(--p2-border-light);
    background: var(--p2-bg-white);
    position: sticky;
    top: 0;
}

.pay2-two-panel-form {
    /* فرم اسکرول خودش را می‌کند */
}

/* backward compat */
.pay2-workshop-layout {
    display: grid;
    grid-template-columns: 380px minmax(0,1fr);
    gap: 18px;
    align-items: start;
    width: 100%;
    direction: ltr;
}

.pay2-workshop-list {
    overflow: hidden;
    border-radius: var(--p2-radius-lg);
    border: 1px solid var(--p2-border-light);
    background: var(--p2-bg-white);
    direction: rtl;
}

.pay2-workshop-form {
    direction: rtl;
}


/* ════════════════════════════════════════════════════════════
   ۱۶. داشبورد — آمار و کارت‌های خلاصه
   ════════════════════════════════════════════════════════════ */

.p2-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.p2-stat-card {
    background: var(--p2-bg-white);
    border: 1px solid var(--p2-border-light);
    border-radius: var(--p2-radius-lg);
    padding: 20px;
    box-shadow: var(--p2-shadow-sm);
}

.p2-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 14px;
}

.p2-stat-label {
    color: var(--p2-text-muted);
    font-size: 12.5px;
    margin-bottom: 4px;
}

.p2-stat-value {
    font-weight: 800;
    font-size: 24px;
    color: var(--p2-text-main);
    line-height: 1.2;
}

/* backward compat */
.dashboard-top-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-icon-box {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 14px;
}

.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

/* ردیف لیست مساعده */
.advance-list-item {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1.5fr 1fr;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--p2-bg-main);
    font-size: 13px;
}

    .advance-list-item:last-child {
        border-bottom: none;
    }


/* ════════════════════════════════════════════════════════════
   ۱۷. حالت خالی و لودینگ (Empty & Loading States)
   ════════════════════════════════════════════════════════════ */

.p2-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--p2-text-muted);
}

    .p2-empty-state i {
        font-size: 3.5rem;
        opacity: 0.2;
        margin-bottom: 16px;
    }

    .p2-empty-state h4 {
        font-size: 16px;
        font-weight: 700;
        color: var(--p2-text-main);
        margin-bottom: 6px;
    }

    .p2-empty-state p {
        font-size: 13px;
        margin: 0;
    }

/* اسپینر لودینگ */
.p2-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--p2-text-muted);
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
}

@keyframes p2Spin {
    to {
        transform: rotate(360deg);
    }
}

.p2-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--p2-border);
    border-top-color: var(--p2-primary);
    border-radius: 50%;
    animation: p2Spin 0.7s linear infinite;
    flex-shrink: 0;
}


/* ════════════════════════════════════════════════════════════
   ۱۸. جداکننده (Divider)
   ════════════════════════════════════════════════════════════ */

.p2-divider {
    border: none;
    border-top: 1px solid var(--p2-border-light);
    margin: 20px 0;
}

.p2-divider-text {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--p2-text-muted);
    font-size: 12px;
    font-weight: 600;
}

    .p2-divider-text::before,
    .p2-divider-text::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--p2-border-light);
    }


/* ════════════════════════════════════════════════════════════
   ۱۹. هاور-کارت و Tooltip ساده
   ════════════════════════════════════════════════════════════ */

.p2-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--p2-border-light);
    font-size: 13px;
}

    .p2-info-row:last-child {
        border-bottom: none;
    }

    .p2-info-row .label {
        color: var(--p2-text-muted);
        font-weight: 600;
    }

    .p2-info-row .value {
        font-weight: 700;
        color: var(--p2-text-main);
    }

        .p2-info-row .value.mono {
            font-family: 'Courier New', monospace;
            font-size: 12px;
        }


/* ════════════════════════════════════════════════════════════
   ۲۰. دکمه‌های ردیف جدول (Table Row Actions)
   ════════════════════════════════════════════════════════════ */

.p2-row-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: var(--p2-radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--p2-text-muted);
    transition: all 0.15s;
    font-size: 14px;
}

    .p2-row-btn:hover {
        background: var(--p2-bg-main);
        color: var(--p2-text-main);
    }

    .p2-row-btn.edit:hover {
        background: var(--p2-primary-light);
        color: var(--p2-primary);
    }

    .p2-row-btn.delete:hover {
        background: var(--p2-danger-bg);
        color: var(--p2-danger-text);
    }


/* ════════════════════════════════════════════════════════════
   ۲۱. فیلتر و سرچ بالای جدول (Table Toolbar)
   ════════════════════════════════════════════════════════════ */

.p2-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

    .p2-table-toolbar .right {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .p2-table-toolbar .left {
        display: flex;
        gap: 8px;
        align-items: center;
    }


/* ════════════════════════════════════════════════════════════
   ۲۲. Utilities — کلاس‌های کمکی
   ════════════════════════════════════════════════════════════ */

.p2-text-primary {
    color: var(--p2-primary) !important;
}

.p2-text-muted {
    color: var(--p2-text-muted) !important;
}

.p2-text-success {
    color: var(--p2-success-text) !important;
}

.p2-text-danger {
    color: var(--p2-danger-text) !important;
}

.p2-text-warning {
    color: var(--p2-warning-text) !important;
}

.p2-text-bold {
    font-weight: 800 !important;
}

.p2-text-mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.p2-text-sm {
    font-size: 12px !important;
}

.p2-text-right {
    text-align: right !important;
}

.p2-text-center {
    text-align: center !important;
}

.p2-mt-0 {
    margin-top: 0 !important;
}

.p2-mt-8 {
    margin-top: 8px !important;
}

.p2-mt-16 {
    margin-top: 16px !important;
}

.p2-mt-24 {
    margin-top: 24px !important;
}

.p2-mb-0 {
    margin-bottom: 0 !important;
}

.p2-mb-8 {
    margin-bottom: 8px !important;
}

.p2-mb-16 {
    margin-bottom: 16px !important;
}


/* ════════════════════════════════════════════════════════════
   ۲۳. Responsive
   ════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .p2-stat-grid,
    .dashboard-top-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .pay2-two-panel,
    .pay2-workshop-layout {
        grid-template-columns: 1fr;
        direction: rtl;
    }

    .pay2-two-panel-list,
    .pay2-workshop-list {
        position: static;
    }

    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   📱 ریسپانسیو برای تبلت و موبایل (کمتر از 900px)
   ========================================================= */
@media (max-width: 900px) {
    .pay2-app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto; /* کل صفحه اسکرول شود */
    }

    /* ۱. سایدبار تبدیل به هدر افقی می‌شود */
    .pay2-sidebar {
        width: 100% !important;
        min-width: 100%;
        height: auto;
        border-left: none;
        border-bottom: 1px solid var(--p2-border);
        flex-direction: column; /* فرزندان زیر هم باشند */
        z-index: 100;
    }

    /* مخفی کردن بخش‌های غیر ضروری در موبایل برای خلوت شدن صفحه */
    .pay2-period-card,
    .pay2-sidebar-footer {
        display: none;
    }

    /* وسط چین کردن لوگو */
    .pay2-brand {
        padding: 12px 16px;
        justify-content: center;
        border-bottom: none;
    }

    /* ۲. منو به صورت افقی و اسکرول‌دار (Swipeable) درمی‌آید */
    .pay2-menu {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 0 10px 10px 10px;
        gap: 8px;
        /* مخفی کردن اسکرول‌بار در مرورگرها */
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }

        .pay2-menu::-webkit-scrollbar {
            display: none; /* Chrome, Safari and Opera */
        }

    .pay2-nav-item {
        flex-direction: row;
        white-space: nowrap;
        padding: 8px 16px;
        margin: 0;
        background: var(--p2-bg-hover);
    }

        .pay2-nav-item.active {
            background-color: var(--p2-primary);
            color: white;
        }

    /* ۳. تنظیم هدر اصلی صفحه (جستجو و عنوان) */
    .pay2-header {
        flex-direction: column;
        gap: 12px;
        height: auto;
        padding: 16px;
        align-items: stretch;
    }

        .pay2-header > div {
            width: 100%;
            justify-content: space-between;
        }

    .pay2-search-wrapper {
        flex: 1;
    }

    .pay2-search-input {
        width: 100%;
    }

    /* ۴. تنظیم محتوا و گریدها */
    .pay2-main {
        overflow: visible;
    }

    .pay2-content {
        padding: 16px;
    }

    /* همه چیز در موبایل تک‌ستونه می‌شود */
    .form-grid-2,
    .form-grid-3,
    .form-grid-4,
    .dashboard-top-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr !important;
    }

    /* فاصله دادن به دکمه‌های مودال در موبایل */
    .card-custom[style*="position:fixed"] > div:last-child > div:last-child {
        flex-direction: column;
    }

        .card-custom[style*="position:fixed"] > div:last-child > div:last-child button {
            width: 100%;
        }
}



/* ═══════════════════════════════════════════════════════════════
   PAY2 Combo / Editable Select / AutoComplete
   ═══════════════════════════════════════════════════════════════ */

.pay2-combo {
    position: relative !important;
    width: 100%;
    direction: rtl;
    box-sizing: border-box;
    z-index: 1;
}

    .pay2-combo.open {
        z-index: 3000;
    }

    .pay2-combo *,
    .pay2-combo *::before,
    .pay2-combo *::after {
        box-sizing: border-box;
    }

    .pay2-combo .pay2-select-control {
        position: relative;
        width: 100%;
        height: var(--p2-input-h, 42px);
        display: flex;
        align-items: center;
        background: var(--p2-bg-main, #f8fafc);
        border: 1px solid var(--p2-border, #e2e8f0) !important;
        border-radius: var(--p2-radius, 10px) !important;
        padding: 0;
        margin: 0;
        overflow: hidden;
        outline: none !important;
        box-shadow: none !important;
        transition: border-color .15s ease, background-color .15s ease;
    }

        .pay2-combo .pay2-select-control:hover {
            border-color: #93c5fd !important;
        }

        .pay2-combo .pay2-select-control.open,
        .pay2-combo .pay2-select-control:focus-within {
            background: #fff;
            border-color: #93c5fd !important;
            outline: none !important;
            box-shadow: none !important;
        }

        .pay2-combo .pay2-select-control.error {
            border-color: #ef4444 !important;
            background: #fff7f7;
        }

        .pay2-combo .pay2-select-control.disabled,
        .pay2-combo .pay2-select-control.readonly {
            opacity: .65;
            cursor: not-allowed;
        }

        .pay2-combo .pay2-select-control::before,
        .pay2-combo .pay2-select-control::after {
            content: none !important;
            display: none !important;
        }

    .pay2-combo .pay2-select-input {
        all: unset;
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
        height: 100%;
        display: block;
        padding: 0 12px;
        margin: 0 !important;
        font-family: inherit;
        font-size: 13px;
        font-weight: 500;
        color: var(--p2-text-main, #1e293b);
        direction: rtl;
        text-align: right;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        cursor: text;
    }

        .pay2-combo .pay2-select-input:focus,
        .pay2-combo .pay2-select-input:focus-visible,
        .pay2-combo .pay2-select-input:hover,
        .pay2-combo .pay2-select-input:active {
            background: transparent !important;
            background-color: transparent !important;
            border: none !important;
            outline: none !important;
            box-shadow: none !important;
        }

        .pay2-combo .pay2-select-input::placeholder {
            color: var(--p2-text-light, #94a3b8);
            font-weight: 400;
        }

    .pay2-combo .pay2-select-clear {
        flex: 0 0 28px;
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        background: transparent !important;
        color: #94a3b8;
        font-size: 20px;
        line-height: 1;
        cursor: pointer;
        border-radius: 8px;
        padding: 0;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .pay2-combo .pay2-select-arrow-button {
        flex: 0 0 38px;
        width: 38px;
        min-width: 38px !important;
        max-width: 38px !important;
        height: 100%;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        background: transparent !important;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }

        .pay2-combo .pay2-select-arrow-button:hover,
        .pay2-combo .pay2-select-arrow-button:focus,
        .pay2-combo .pay2-select-arrow-button:focus-visible,
        .pay2-combo .pay2-select-arrow-button:active {
            border: none !important;
            outline: none !important;
            box-shadow: none !important;
            background: #f1f5f9 !important;
        }

    .pay2-combo .pay2-select-arrow {
        width: 8px;
        height: 8px;
        border-left: 2px solid #64748b;
        border-bottom: 2px solid #64748b;
        transform: rotate(-45deg);
        margin-top: -4px;
        transition: transform .15s ease, margin-top .15s ease;
    }

    .pay2-combo .pay2-select-control.open .pay2-select-arrow {
        transform: rotate(135deg);
        margin-top: 4px;
    }

    .pay2-combo .pay2-select-backdrop {
        position: fixed;
        inset: 0;
        z-index: 2998;
        background: transparent;
    }

    .pay2-combo .pay2-select-menu {
        position: absolute !important;
        z-index: 2999;
        top: calc(100% + 5px) !important;
        right: 0 !important;
        left: auto !important;
        width: 100% !important;
        max-height: 300px;
        overflow-y: auto;
        background: #fff;
        border: 1px solid var(--p2-border, #e2e8f0);
        border-radius: 12px;
        box-shadow: 0 14px 28px rgba(15, 23, 42, .12);
        padding: 6px;
    }

    .pay2-combo .pay2-select-item {
        width: 100%;
        min-height: 36px;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        background: transparent;
        color: var(--p2-text-main, #1e293b);
        font-family: inherit;
        font-size: 13px;
        text-align: right;
        border-radius: 8px;
        padding: 7px 10px;
        cursor: pointer;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 3px 8px;
        align-items: center;
    }

        .pay2-combo .pay2-select-item:hover,
        .pay2-combo .pay2-select-item:focus,
        .pay2-combo .pay2-select-item:focus-visible,
        .pay2-combo .pay2-select-item.highlighted {
            border: none !important;
            outline: none !important;
            box-shadow: none !important;
            background: #f1f5f9;
            color: #1e293b;
        }

        .pay2-combo .pay2-select-item.selected {
            background: #eff6ff;
            color: #2563eb;
            font-weight: 700;
        }

            .pay2-combo .pay2-select-item.selected.highlighted,
            .pay2-combo .pay2-select-item.selected:hover {
                background: #dbeafe;
                color: #1d4ed8;
            }

    .pay2-combo .pay2-select-item-main {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .pay2-combo .pay2-select-item-sub {
        grid-column: 1 / span 2;
        color: #64748b;
        font-size: 11px;
        font-weight: 400;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .pay2-combo .pay2-select-item-badge {
        background: #f1f5f9;
        color: #475569;
        border-radius: 999px;
        padding: 2px 8px;
        font-size: 11px;
        font-weight: 600;
    }

    .pay2-combo .pay2-select-state,
    .pay2-combo .pay2-select-empty,
    .pay2-combo .pay2-select-more {
        min-height: 36px;
        color: #64748b;
        font-size: 12px;
        padding: 9px 10px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .pay2-combo .pay2-select-empty {
        justify-content: center;
    }

    .pay2-combo .pay2-select-more {
        border-top: 1px solid #f1f5f9;
        color: #94a3b8;
        font-size: 11px;
    }


/* ========================================================
   استایل‌های جدید برای مدال‌های ثابت و ریسپانسیو
   ======================================================== */

.pay2-modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 950px;
    height: 90vh; /* ارتفاع ثابت 90 درصد صفحه */
    z-index: 3000;
    padding: 0;
    display: flex;
    flex-direction: column; /* برای قرارگیری Header، Body، Footer */
    background: var(--p2-bg-white);
    border-radius: var(--p2-radius-lg);
    box-shadow: var(--p2-shadow-xl);
    overflow: hidden;
}

.pay2-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--p2-border-light);
    background: var(--p2-bg-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* جلوگیری از کوچک شدن هدر */
}

.pay2-modal-body {
    padding: 24px;
    overflow-y: auto; /* فقط این بخش اسکرول می‌خورد */
    flex-grow: 1; /* گرفتن تمام فضای باقیمانده */
    background: var(--p2-bg-white);
}

.pay2-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--p2-border-light);
    background: var(--p2-bg-main);
    display: flex;
    justify-content: flex-start; /* در صورت نیاز به چپ‌چین بودن */
    flex-shrink: 0; /* جلوگیری از کوچک شدن فوتر */
}

/* برای جداول که در موبایل از صفحه خارج نشوند */
.pay2-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--p2-border-light);
    border-radius: var(--p2-radius-sm);
    margin-top: 10px;
}

    .pay2-table-responsive .p2-table {
        min-width: 700px; /* اگر صفحه کوچک شد، جدول اسکرول افقی بخورد نه اینکه فشرده شود */
    }

@media (max-width: 768px) {
    .pay2-modal-container {
        width: 100%;
        height: 100vh; /* در موبایل تمام صفحه باشد */
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ========================================================
   استایل‌های سفارشی برای منوی کشویی (MudMenu)
   ======================================================== */

.pay2-more-menu {
    border-radius: var(--p2-radius-md) !important;
    font-family: var(--p2-font) !important;
    direction: rtl;
    border: 1px solid var(--p2-border-light);
    overflow: hidden !important; /* این خط باعث می‌شود گوشه‌های داخلی تیز بیرون نزنند */
    margin-right: 15px !important; /* ایجاد فاصله از لبه چپ مانیتور */
}

    /* گرد کردن لبه‌های داخلی آیتم‌ها و ایجاد فاصله مناسب */
    .pay2-more-menu .mud-list-item {
        border-radius: 8px !important;
        margin: 4px 8px !important;
        min-height: 38px !important;
    }

        .pay2-more-menu .mud-list-item:hover {
            background-color: var(--p2-bg-main) !important;
        }


/* ========================================================
   افکت‌های هاور (Hover) برای دکمه‌های عملیات در جداول
   ======================================================== */

.p2-action-edit {
    color: var(--p2-primary);
}

    .p2-action-edit:hover {
        background-color: var(--p2-primary-light) !important;
        color: var(--p2-primary-dark) !important;
        transform: translateY(-1px);
    }

.p2-action-decree {
    color: #8b5cf6; /* بنفش روشن */
}

    .p2-action-decree:hover {
        background-color: #ede9fe !important; /* پس‌زمینه بنفش خیلی ملایم */
        color: #6d28d9 !important; /* بنفش تیره */
        transform: translateY(-1px);
    }

.p2-action-leave {
    color: #f59e0b; /* نارنجی/کهربایی */
}

    .p2-action-leave:hover {
        background-color: #fef3c7 !important; /* پس‌زمینه زرد ملایم */
        color: #d97706 !important; /* نارنجی تیره */
        transform: translateY(-1px);
    }

/* ترانزیشن نرم برای همه دکمه‌های گوست */
.btn-ghost-pay2 {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px 16px;
}

@media (max-width: 900px) {
    .form-grid-5 {
        grid-template-columns: 1fr !important;
    }
}