/* ===================================================================
   REQUEST.CSS — سیستم درخواست‌ها
   =================================================================== */

/* ── فیلترها ── */
.req-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.req-status-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    padding-bottom: 4px;
}

.req-status-tabs::-webkit-scrollbar {
    display: none;
}

.req-status-tab {
    padding: 7px 16px;
    border-radius: 50px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.req-status-tab:hover {
    border-color: #C8102E;
    color: #C8102E;
}

.req-status-tab.active {
    background: #C8102E;
    border-color: #C8102E;
    color: #fff;
}

/* ── شمارش روی تب‌های وضعیت ── */
.req-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 800;
    margin-right: 6px;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    line-height: 1;
    vertical-align: middle;
}

.req-status-tab.active .req-tab-count {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* ── سرچ (فقط ادمین) ── */
.req-search-wrap {
    position: relative;
    flex: 0 0 auto;
    min-width: 220px;
}

.req-search-wrap svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.req-search-input {
    width: 100%;
    padding: 9px 38px 9px 14px !important;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.83rem;
    color: #374151;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.req-search-input:focus {
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

/* ── لیست درخواست‌ها ── */
.req-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.req-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.req-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
}

.req-card-body {
    flex: 1;
    min-width: 0;
}

.req-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.req-card-number {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 50px;
    direction: ltr;
    display: inline-block;
}

.req-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.req-card-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.req-card-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.req-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #6b7280;
}

.req-meta-item svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.req-meta-item strong {
    color: #374151;
    font-weight: 700;
}

.req-card-date {
    font-size: 0.73rem;
    color: #9ca3af;
    flex-shrink: 0;
    text-align: left;
    direction: ltr;
}

.req-card-arrow {
    color: #9ca3af;
    flex-shrink: 0;
    align-self: center;
}

/* ── لودینگ / خالی ── */
.req-loading,
.req-empty {
    text-align: center;
    padding: 48px 24px;
    color: #9ca3af;
    font-size: 0.88rem;
    font-weight: 600;
    background: #fff;
    border-radius: 16px;
}

.req-empty-icon {
    width: 56px;
    height: 56px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #9ca3af;
}

/* ── صفحه‌بندی ── */
.req-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.req-page-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.req-page-btn:hover,
.req-page-btn.active {
    background: #C8102E;
    border-color: #C8102E;
    color: #fff;
}

/* ── مودال جزئیات ── */
.req-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.req-detail-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.req-detail-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s ease;
}

.req-detail-overlay.active .req-detail-modal {
    transform: translateY(0) scale(1);
}

.req-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 20px 20px 0 0;
}

.req-detail-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.req-detail-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.req-detail-close:hover {
    background: #fee2e2;
    color: #C8102E;
}

.req-detail-body {
    padding: 24px;
}

/* ── فیلدهای جزئیات ── */
.req-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.req-info-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 14px;
}

.req-info-item.full-width {
    grid-column: 1 / -1;
}

.req-info-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: 4px;
    display: block;
}

.req-info-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.5;
}

/* ── فرم ادمین ── */
.req-admin-section {
    border-top: 2px solid #f3f4f6;
    padding-top: 20px;
    margin-top: 4px;
}

.req-admin-section h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: #374151;
    margin-bottom: 14px;
}

.req-admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.req-admin-form label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
    display: block;
    margin-bottom: 5px;
}

.req-admin-form select,
.req-admin-form textarea {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.85rem;
    color: #374151;
    padding: 10px 12px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.req-admin-form select:focus,
.req-admin-form textarea:focus {
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

.req-admin-form textarea {
    resize: vertical;
    min-height: 80px;
}

.req-admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.req-save-btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: #C8102E;
    color: #fff;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.req-save-btn:hover {
    background: #9b0b22;
}

.req-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.req-delete-btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: 1.5px solid #fee2e2;
    background: #fff5f5;
    color: #C8102E;
    font-family: 'Kalameh', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    margin-right: auto;
    transition: all 0.2s;
}

.req-delete-btn:hover {
    background: #C8102E;
    color: #fff;
    border-color: #C8102E;
}

.req-admin-msg {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0;
}

.req-admin-msg.success {
    color: #059669;
}

.req-admin-msg.error {
    color: #C8102E;
}

/* ── آمار داشبورد ── */
.req-dash-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.req-dash-stat {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.req-dash-stat-num {
    font-size: 1.4rem;
    font-weight: 900;
    color: #111827;
    line-height: 1;
    margin-bottom: 5px;
}

.req-dash-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .req-panel-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .req-search-wrap {
        min-width: 0;
        width: 100%;
    }

    .req-info-grid {
        grid-template-columns: 1fr;
    }

    .req-info-item.full-width {
        grid-column: 1;
    }

    .req-dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .req-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .req-dash-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── مخفی کردن عنوان فرم گرویتی در مودال درخواست ── */
.req-gf-wrap .gform_heading {
    display: none !important;
}