﻿/* ═══════════════════════════════════════════════════
   FEATURE / Moadian — سامانه مودیان
   ═══════════════════════════════════════════════════ */

.moadian-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ═══ Tabs ═══ */
.moadian-tabs {
    display: flex;
    gap: 6px;
    background: #fff;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
}

.moadian-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: #6B7280;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
}

    .moadian-tab:hover {
        background: #F9FAFB;
        color: #4F46E5;
    }

    .moadian-tab.active {
        background: linear-gradient(135deg, #4F46E5, #7C3AED);
        color: #fff;
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    }

/* ═══ Stats ═══ */
.moadian-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 4px;
}

.moadian-stat {
    background: #FFF;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #E5E7EB;
    border-right: 4px solid #94A3B8;
}

.moadian-stat-total {
    border-right-color: #6366F1;
}

.moadian-stat-pending {
    border-right-color: #F59E0B;
    background: #FFFBEB;
}

.moadian-stat-sent {
    border-right-color: #3B82F6;
}

.moadian-stat-error {
    border-right-color: #EF4444;
    background: #FEF2F2;
}

.moadian-stat-success {
    border-right-color: #10B981;
    background: #F0FDF4;
}

.moadian-stat-label {
    font-size: 12px;
    color: #64748B;
    margin-bottom: 6px;
}

.moadian-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1F2937;
    font-variant-numeric: tabular-nums;
}

/* ═══ Badges ═══ */
.moadian-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.moadian-badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.moadian-badge-sent {
    background: #DBEAFE;
    color: #1E40AF;
}

.moadian-badge-error {
    background: #FEE2E2;
    color: #991B1B;
}

.moadian-badge-success {
    background: #D1FAE5;
    color: #065F46;
}

/* ═══ Table ═══ */
.moadian-table {
    width: 100%;
    font-size: 13px;
}

    .moadian-table th {
        background: #F8FAFC;
        padding: 10px 8px;
        border-bottom: 2px solid #E2E8F0;
        font-weight: 600;
        font-size: 12px;
        white-space: nowrap;
    }

    .moadian-table td {
        padding: 8px;
        border-bottom: 1px solid #F1F5F9;
        vertical-align: middle;
    }

    .moadian-table tbody tr:hover {
        background: #F8FAFC;
    }

/* رنگ ردیف بر اساس وضعیت */
.moadian-row.status-2 {
    background: #FEF2F2 !important;
}

.moadian-row.status-3 {
    background: #F0FDF4 !important;
}

/* ═══ Form ═══ */
.moadian-form {
    max-width: 780px;
}

    .moadian-form .form-group {
        margin-bottom: 18px;
    }

    .moadian-form label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 6px;
    }

        .moadian-form label .req {
            color: #EF4444;
        }

    .moadian-form input[type="text"],
    .moadian-form textarea {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        font-family: inherit;
        font-size: 13.5px;
        background: #fff;
        transition: all 0.15s;
        box-sizing: border-box;
    }

        .moadian-form input[type="text"]:focus,
        .moadian-form textarea:focus {
            outline: none;
            border-color: #4F46E5;
            box-shadow: 0 0 0 3px #EEF2FF;
        }

    .moadian-form textarea {
        resize: vertical;
        min-height: 120px;
    }

.moadian-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

    .moadian-checkbox-label:hover {
        background: #EEF2FF;
        border-color: #4F46E5;
    }

    .moadian-checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: #4F46E5;
    }

.moadian-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid #E5E7EB;
}

/* ═══ Info Box ═══ */
.moadian-info-box {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 13px;
}

.moadian-info-success {
    background: #F0FDF4;
    border-color: #86EFAC;
}

.moadian-info-error {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

.moadian-info-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
}

.moadian-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    gap: 12px;
}

    .moadian-info-row:last-child {
        border-bottom: none;
    }

    .moadian-info-row > span:first-child {
        color: #6B7280;
        font-weight: 500;
    }

    .moadian-info-row > strong {
        color: #111827;
        font-weight: 700;
    }

/* ═══ Detail Modal ═══ */
.moadian-detail {
    padding: 4px;
}

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
    .moadian-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .moadian-tabs {
        flex-direction: column;
    }

    .moadian-tab {
        width: 100%;
        text-align: right;
    }
}

@media (max-width: 600px) {
    .moadian-stats {
        grid-template-columns: 1fr;
    }
}

/* ═══ Filter Bar ═══ */
.moadian-filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

    .moadian-filter-bar .form-group {
        margin: 0;
        flex: 1;
        min-width: 200px;
    }

    .moadian-filter-bar input[type="text"],
    .moadian-filter-bar select {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        font-family: inherit;
        font-size: 13px;
        min-height: 38px;
    }

        .moadian-filter-bar input:focus,
        .moadian-filter-bar select:focus {
            outline: none;
            border-color: #4F46E5;
            box-shadow: 0 0 0 3px #EEF2FF;
        }

/* ═══ Sortable Columns ═══ */
.moadian-table th.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

    .moadian-table th.sortable-th:hover {
        background: #EEF2FF;
        color: #4F46E5;
    }

.moadian-table th.sort-active {
    background: #EEF2FF;
    color: #4F46E5;
    font-weight: 700;
}