/* ======================================= */
/* 🎨 فایل استایل فرم‌ها — crud-form.css */
/* مخصوص صفحات create و edit */
/* طراحی تیره + رنگ برند نارنجی (#ffa500) */
/* فونت اصلی: Vazir */
/* ======================================= */

/* فرم‌های خاص صفحات (فرم‌های داخلی صفحه) */
.page-form-container {
    max-width: 50rem;
    margin: 0 auto;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: #1f2937;
    color: #f3f4f6;
    max-height: 80vh;   /* حداکثر ارتفاع فرم */
    overflow-y: auto;   /* اسکرول عمودی وقتی لازم شد */
    box-sizing: border-box;
}

/* برچسب‌ها */
.form-label {
    display: block;
    margin-bottom: 0.25rem;
    color: #f1f1f1;
    font-weight: 700;
    font-size: 1.2rem;
}

/* فیلدهای ورودی عمومی داخل فرم‌ها (غیر از crud-form-input که در crud-base هست) */
.form-input,
.date-field,
.time-field,
.filter-form input,
.filter-form select,
.crud-input {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #111827;
    color: #fff;
    border: 1px solid #374151;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-input:focus,
.date-field:focus,
.time-field:focus,
.crud-input:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 0 2px rgba(255,165,0,0.3);
}

/* گروه‌بندی فیلدها */
.form-group {
    margin-bottom: .02rem;
}

/* متن راهنما */
.form-text {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* دکمه‌های ناوبری مراحل */
.step-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.btn-next,
.btn-prev {
    background-color: transparent;
    color: #ffa500;
    border: 1px solid #ffa500;
    padding: 0.45rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-next:hover,
.btn-prev:hover {
    background-color: #ffa500;
    color: #111;
}

/* دکمه خاکستری سفارشی */
.crud-btn.btn-gray-custom {
    background-color: #6b7280 !important;
    color: #fff;
    border: none;
    transition: background-color 0.2s ease;
}

.crud-btn.btn-gray-custom:hover {
    background-color: #4b5563;
}

/* فرم چندمرحله‌ای */
.form-step {
    display: none;
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: #374151;
    color: #d1d5db;
    font-weight: 600;
    transition: all 0.3s;
    animation: fadeIn 0.3s ease-in-out;
}

.form-step.active {
    display: block;
    background-color: #92908c;
    color: #111827;
}

.form-select {
    background-color: #1f2937;
    color: #ffffff;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

/* تیتر هر مرحله */
.form-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffa500;
    margin-bottom: 1rem;
    border-right: 3px solid #ffa500;
    padding-right: 0.75rem;
}

/* textarea عمومی (غیر از crud-form-textarea که تو base هست) */
.form-textarea {
    background-color: #818283;
    color: #ffffff;
    border: 1px solid #656d79;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
}

/* نوار پیشرفت مراحل */
.form-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.form-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 3px;
    background-color: #333;
    transform: translateY(-50%);
    z-index: 0;
}

.progress-step {
    width: 25px;
    height: 25px;
    background-color: #333;
    border: 2px solid #ffa500;
    border-radius: 50%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffa500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.progress-step.active {
    background-color: #ffa500;
    color: #111;
}

/* استایل گزارشات */
.report-page-container {
    width: 100%;
    padding: 1rem;
}

.report-title {
    font-size: 1.75rem;
    font-weight: bold;
    color: #0a0909;
    margin-bottom: 1rem;
    text-align: center;
}

.report-period-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.report-label {
    font-weight: bold;
    color: #fff;
}

.report-select {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #ccc;
    background: #111827;
    color: #fff;
}

.report-btn {
    background-color: #3b82f6;
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

.report-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .report-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.report-chart-box {
    background: #1f2937;
    padding: 1rem;
    border-radius: 0.5rem;
    color: #fff;
}

.report-chart-title {
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #fff;
}

.report-chart-span2 {
    grid-column: span 2;
}

.report-analysis {
    background: #1f2937;
    padding: 1rem;
    border-radius: 0.5rem;
    color: #fff;
    margin-top: 2rem;
}

.report-analysis-title {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #fff;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.report-table th,
.report-table td {
    border: 1px solid #ccc;
    padding: 0.5rem;
}

.report-table th {
    background: #374151;
    color: #fff;
}

.report-table td {
    background: #111827;
    color: #fbbf24;
}

/* ======================================= */
/* دکمه بروزرسانی عضو — نسخه CRUD */
/* ======================================= */
.crud-btn-submit {
    background-color: #ffa500;
    color: #111827;
    padding: 0.5rem 1.4rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.3rem;
    white-space: nowrap;
}

.crud-btn-submit:hover {
    background-color: #ff8c00;
    color: #fff;
}

/* فرم‌های جستجوی اعضا */
/* فرم های جستجو اعضا / اشتراک‌ها و ... */

.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* فیلدهای داخل ردیف جستجو باید خودشان جمع شوند، نه 100% عرض */
.search-row .crud-input,
.search-row input,
.search-row select {
    flex: 1 1 150px;  /* حداقل 150px، بقیه‌اش بر اساس فضا */
    min-width: 0;     /* اجازه نده خودش بیش از حد بزرگ بشه */
    width: auto;      /* روی flex-basis تکیه کن، نه width:100% */
}

/* ردیف مخصوص دکمه‌ها */
.search-buttons {
    justify-content: flex-start;
    gap: 1rem;
}

/* روی موبایل: ردیف‌ها ستونی بشن تا هیچ‌چیزی از عرض نزنه بیرون */
@media (max-width: 640px) {
    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-row .crud-input,
    .search-row input,
    .search-row select {
        flex: 1 1 100%;
        width: 100%;
    }

    .search-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .search-buttons .crud-btn {
        flex: 1 1 45%;
        text-align: center;
    }
}
