/**
 * Webifa Invoice Manager - Frontend Styles
 * webifa.ir
 */

/* ─── متغیرها ─── */
:root {
    --webifa-primary:   #0070f3;
    --webifa-success:   #16a34a;
    --webifa-warning:   #d97706;
    --webifa-danger:    #dc2626;
    --webifa-border:    #e5e7eb;
    --webifa-bg:        #f9fafb;
    --webifa-radius:    8px;
    --webifa-shadow:    0 1px 4px rgba(0,0,0,.08);
}

/* ─── کانتینر اصلی ─── */
.webifa-my-invoices,
.webifa-invoice-detail {
    font-family: inherit;
    direction: rtl;
}

.webifa-section-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--webifa-primary);
    padding-bottom: .4rem;
}

/* ─── جدول ─── */
.webifa-table-wrap { overflow-x: auto; }

.webifa-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--webifa-radius);
    box-shadow: var(--webifa-shadow);
    overflow: hidden;
}

.webifa-table th,
.webifa-table td {
    padding: .75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--webifa-border);
    font-size: .9rem;
}

.webifa-table th {
    background: var(--webifa-bg);
    font-weight: 600;
}

.webifa-table tfoot td {
    border-top: 2px solid var(--webifa-border);
    border-bottom: none;
}

/* ─── بج وضعیت ─── */
.webifa-status-badge {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
}

.webifa-status-pending          { background: #fef9c3; color: #92400e; }
.webifa-status-pending_customer { background: #dbeafe; color: #1e40af; }
.webifa-status-confirmed        { background: #dcfce7; color: #166534; }
.webifa-status-paid_pending     { background: #e0f2fe; color: #075985; }
.webifa-status-paid             { background: #bbf7d0; color: #14532d; }
.webifa-status-cancelled        { background: #fee2e2; color: #991b1b; }

/* ─── دکمه‌ها ─── */
.webifa-btn {
    display: inline-block;
    padding: .5rem 1.25rem;
    background: var(--webifa-primary);
    color: #fff !important;
    border: none;
    border-radius: var(--webifa-radius);
    cursor: pointer;
    font-size: .9rem;
    text-decoration: none;
    transition: background .2s;
}

.webifa-btn:hover { background: #005dd1; color: #fff; }

.webifa-btn-pay {
    background: var(--webifa-success);
}

.webifa-btn-pay:hover { background: #15803d; }

.webifa-btn-sm { padding: .3rem .8rem; font-size: .82rem; }
.webifa-btn-lg { padding: .7rem 2rem; font-size: 1rem; }

/* ─── جزئیات فاکتور ─── */
.webifa-back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--webifa-primary);
    text-decoration: none;
    font-size: .88rem;
}

.webifa-inv-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.webifa-inv-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.webifa-inv-desc,
.webifa-admin-notes {
    background: var(--webifa-bg);
    border: 1px solid var(--webifa-border);
    border-radius: var(--webifa-radius);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: .9rem;
}

.webifa-admin-notes h4,
.webifa-inv-items h4 { margin-top: 0; }

.webifa-inv-total {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

.webifa-amount {
    color: var(--webifa-primary);
    font-weight: 700;
}

/* ─── بخش تایید فاکتور ─── */
.webifa-confirm-section {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--webifa-radius);
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.webifa-confirm-section h4 { margin-top: 0; color: #1e40af; }
.webifa-confirm-intro      { margin-bottom: 1rem; font-size: .9rem; color: #374151; }

.webifa-check-label {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: .75rem;
    cursor: pointer;
    font-size: .9rem;
    line-height: 1.5;
}

.webifa-check-label input[type="checkbox"] {
    margin-top: .2rem;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ─── پیام‌ها ─── */
.webifa-msg {
    padding: .75rem 1rem;
    border-radius: var(--webifa-radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}

.webifa-msg.success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.webifa-msg.error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ─── بخش پرداخت ─── */
.webifa-pay-section {
    text-align: center;
    margin: 1.5rem 0;
}

.webifa-pay-note {
    font-size: .82rem;
    color: #6b7280;
    margin-top: .5rem;
}

/* ─── فرم درخواست ─── */
.webifa-request-form-wrap { max-width: 600px; }

.webifa-field { margin-bottom: 1.1rem; }

.webifa-field label {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
    font-size: .9rem;
}

.webifa-field label span { color: var(--webifa-danger); }

.webifa-field input,
.webifa-field textarea {
    width: 100%;
    padding: .55rem .8rem;
    border: 1px solid var(--webifa-border);
    border-radius: var(--webifa-radius);
    font-size: .9rem;
    box-sizing: border-box;
    transition: border-color .2s;
}

.webifa-field input:focus,
.webifa-field textarea:focus {
    outline: none;
    border-color: var(--webifa-primary);
    box-shadow: 0 0 0 3px rgba(0,112,243,.12);
}

/* ─── تصویر وضعیت سفارش ─── */
.webifa-order-status-image {
    margin: 1.5rem 0;
    border: 1px solid var(--webifa-border);
    border-radius: var(--webifa-radius);
    padding: 1.25rem;
    background: var(--webifa-bg);
}

.webifa-status-image-title {
    margin-top: 0;
    font-size: 1rem;
}

.webifa-status-image-title span { color: var(--webifa-primary); }

.webifa-status-img-wrap { margin: .75rem 0; }

.webifa-status-img {
    max-width: 100%;
    border-radius: var(--webifa-radius);
    box-shadow: var(--webifa-shadow);
}

.webifa-status-note {
    background: #fff;
    border-right: 3px solid var(--webifa-primary);
    padding: .5rem .75rem;
    margin: 0;
    font-size: .88rem;
    color: #374151;
}

/* ─── خالی ─── */
.webifa-empty {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    background: var(--webifa-bg);
    border-radius: var(--webifa-radius);
}

/* ─── متا دیتا ─── */
.webifa-inv-meta {
    margin-top: 1rem;
    color: #9ca3af;
    font-size: .8rem;
}

/* ─── ریسپانسیو ─── */
@media (max-width: 600px) {
    .webifa-table th:nth-child(n+4),
    .webifa-table td:nth-child(n+4) { display: none; }

    .webifa-confirm-section { padding: .9rem; }
    .webifa-btn-lg { width: 100%; text-align: center; }
}
