/**
 * نظام الوكلاء — منصة المقايضة الذكية | أنماط الواجهة الأمامية
 * RTL + متجاوب + معزول ببادئة hwk-ag- لمنع التعارض مع القالب والإضافة الأساسية.
 * الألوان تتبع متغيرات المنصة --hwk-primary و --hwk-accent مع بدائل ثابتة.
 */

/* ===== الأساسيات ===== */
.hwk-ag-dashboard,
.hwk-ag-register,
.hwk-ag-nearest,
.hwk-ag-my-requests,
.hwk-ag-agents-directory {
        direction: rtl;
        font-family: inherit;
        color: #22303f;
        max-width: 100%;
}

.hwk-ag-section-title {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 20px;
        font-weight: 800;
        color: var(--hwk-primary, #1f3b57);
        margin: 0 0 14px;
}
.hwk-ag-section-title i { color: var(--hwk-accent, #ff9f1c); }

.hwk-ag-subtitle {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 16px;
        font-weight: 800;
        color: var(--hwk-primary, #1f3b57);
        margin: 22px 0 10px;
}
.hwk-ag-subtitle i { color: var(--hwk-accent, #ff9f1c); }

.hwk-ag-muted { color: #5d6f82; }
.hwk-ag-small { font-size: 12.5px; }

/* ===== البطاقات ===== */
.hwk-ag-card {
        background: #fff;
        border: 1px solid #dfe6ee;
        border-radius: 14px;
        padding: 18px 20px;
        margin: 0 0 14px;
        box-shadow: 0 1px 3px rgba(31, 59, 87, 0.05);
        break-inside: avoid;
}

.hwk-ag-cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 14px;
}
.hwk-ag-cards-grid .hwk-ag-card { margin: 0; }

/* ===== الشارات ===== */
.hwk-ag-badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        border-radius: 999px;
        padding: 3px 12px;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.6;
        white-space: nowrap;
}
.hwk-ag-badge-ok { background: #e5f6ec; color: #137a3e; }
.hwk-ag-badge-warn { background: #fff2df; color: #9a5b00; }
.hwk-ag-badge-bad { background: #fdeaea; color: #a02323; }
.hwk-ag-badge-info { background: #e8f0fa; color: #1d4f8c; }
.hwk-ag-badge-muted { background: #eef1f5; color: #5d6f82; }
.hwk-ag-badge-type { background: #fff7ec; color: #8a5200; border: 1px dashed #ffd9a3; }
.hwk-ag-badges-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

/* ===== التنبيهات ===== */
.hwk-ag-alert {
        border-radius: 12px;
        padding: 13px 18px;
        margin: 0 0 14px;
        font-size: 14px;
        display: flex;
        align-items: flex-start;
        gap: 9px;
        line-height: 1.8;
}
.hwk-ag-alert i { margin-top: 4px; }
.hwk-ag-alert-info { background: #e8f0fa; border: 1px solid #c5d8f0; color: #1d4f8c; }
.hwk-ag-alert-warn { background: #fff7ec; border: 1px solid #ffd9a3; color: #8a5200; }
.hwk-ag-alert-bad { background: #fdeaea; border: 1px solid #f5c2c2; color: #a02323; }
.hwk-ag-alert-ok { background: #ecfaf1; border: 1px solid #b8e6cd; color: #166534; }

/* ===== الأزرار ===== */
.hwk-ag-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        border: 0;
        border-radius: 10px;
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        text-decoration: none !important;
        transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
        line-height: 1.6;
}
.hwk-ag-btn:active { transform: translateY(1px); }
.hwk-ag-btn-primary {
        background: var(--hwk-primary, #1f3b57);
        color: #fff;
}
.hwk-ag-btn-primary:hover { background: #16293d; color: #fff; box-shadow: 0 4px 14px rgba(31, 59, 87, 0.3); }
.hwk-ag-btn-accent {
        background: var(--hwk-accent, #ff9f1c);
        color: #3a2500;
}
.hwk-ag-btn-accent:hover { background: #f08c00; color: #3a2500; box-shadow: 0 4px 14px rgba(255, 159, 28, 0.35); }
.hwk-ag-btn-outline {
        background: transparent;
        color: var(--hwk-primary, #1f3b57);
        border: 2px solid var(--hwk-primary, #1f3b57);
}
.hwk-ag-btn-outline:hover { background: rgba(31, 59, 87, 0.06); color: var(--hwk-primary, #1f3b57); }
.hwk-ag-btn-danger { background: #fdeaea; color: #a02323; border: 1px solid #f5c2c2; }
.hwk-ag-btn-danger:hover { background: #fbdcdc; color: #a02323; }
.hwk-ag-btn-lg { padding: 13px 30px; font-size: 15px; }
.hwk-ag-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ===== النماذج ===== */
.hwk-ag-form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
        margin: 10px 0;
}
.hwk-ag-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hwk-ag-field-full { grid-column: 1 / -1; }
.hwk-ag-field > span { font-weight: 700; font-size: 12.5px; color: #22303f; }
.hwk-ag-field input,
.hwk-ag-field select,
.hwk-ag-field textarea {
        width: 100%;
        border: 1.5px solid #dfe6ee;
        border-radius: 10px;
        padding: 10px 13px;
        font-size: 14px;
        background: #fbfcfe;
        color: #22303f;
        box-sizing: border-box;
        transition: border-color 0.15s ease;
}
.hwk-ag-field input:focus,
.hwk-ag-field select:focus,
.hwk-ag-field textarea:focus {
        outline: none;
        border-color: var(--hwk-accent, #ff9f1c);
        background: #fff;
}
.hwk-ag-checkbox { flex-direction: row; align-items: center; gap: 8px; }
.hwk-ag-checkbox input { width: 18px; height: 18px; accent-color: var(--hwk-primary, #1f3b57); }
.hwk-ag-checkbox span { font-weight: 500; }

.hwk-ag-form-msg { margin-top: 6px; font-size: 13.5px; font-weight: 700; min-height: 4px; }
.hwk-ag-form-msg.ok { color: #137a3e; }
.hwk-ag-form-msg.bad { color: #a02323; }

/* ===== جدول ===== */
.hwk-ag-table {
        width: 100%;
        border-collapse: collapse;
        background: #fff;
        border: 1px solid #dfe6ee;
        border-radius: 12px;
        overflow: hidden;
        font-size: 13.5px;
}
.hwk-ag-table thead th {
        background: var(--hwk-primary, #1f3b57);
        color: #fff;
        padding: 10px 12px;
        text-align: right;
        font-size: 12.5px;
        font-weight: 700;
}
.hwk-ag-table td { padding: 10px 12px; border-top: 1px solid #eef1f5; vertical-align: middle; }
.hwk-ag-table tr:hover td { background: #f8fafc; }

/* ===== لوحة الوكيل: الترحيب ===== */
.hwk-ag-welcome {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        background: linear-gradient(135deg, var(--hwk-primary, #1f3b57), #2c4f74);
        color: #fff;
        border-radius: 16px;
        padding: 22px 24px;
        margin-bottom: 16px;
}
.hwk-ag-welcome h3 { margin: 0 0 8px; font-size: 21px; display: flex; align-items: center; gap: 9px; }
.hwk-ag-welcome p { margin: 0; display: flex; gap: 7px; flex-wrap: wrap; }
.hwk-ag-welcome-stats { display: flex; gap: 12px; }
.hwk-ag-welcome-stats > div {
        background: rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        padding: 10px 18px;
        text-align: center;
        min-width: 84px;
}
.hwk-ag-welcome-stats strong { display: block; font-size: 22px; }
.hwk-ag-welcome-stats span { font-size: 11.5px; opacity: 0.85; }

/* ===== تبويبات اللوحة ===== */
.hwk-ag-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0 0 18px;
}
.hwk-ag-tab {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        background: #fff;
        border: 1.5px solid #dfe6ee;
        border-radius: 999px;
        padding: 9px 18px;
        font-size: 13.5px;
        font-weight: 700;
        color: #22303f;
        text-decoration: none !important;
        position: relative;
}
.hwk-ag-tab i { color: #5d6f82; }
.hwk-ag-tab.active {
        background: var(--hwk-primary, #1f3b57);
        border-color: var(--hwk-primary, #1f3b57);
        color: #fff;
}
.hwk-ag-tab.active i { color: var(--hwk-accent, #ff9f1c); }
.hwk-ag-count {
        background: #e02020;
        color: #fff;
        border-radius: 999px;
        min-width: 20px;
        height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        padding: 0 6px;
}

/* ===== بطاقات الإحصاء ===== */
.hwk-ag-stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
        margin-bottom: 16px;
}
.hwk-ag-stat-card {
        background: #fff;
        border: 1px solid #dfe6ee;
        border-radius: 14px;
        padding: 16px 14px;
        text-align: center;
}
.hwk-ag-stat-card i { font-size: 20px; color: #8aa0b8; margin-bottom: 6px; display: inline-block; }
.hwk-ag-stat-card.hwk-ac-info i { color: #1d4f8c; }
.hwk-ag-stat-card.hwk-ac-warn i { color: #d97706; }
.hwk-ag-stat-card.hwk-ac-ok i { color: #16a34a; }
.hwk-ag-stat-card.hwk-ac-bad i { color: #dc2626; }
.hwk-ag-stat-num { font-size: 26px; font-weight: 900; color: var(--hwk-primary, #1f3b57); line-height: 1.2; }
.hwk-ag-stat-label { font-size: 12px; color: #5d6f82; margin-top: 3px; }

.hwk-ag-info-card { border-inline-start: 4px solid var(--hwk-accent, #ff9f1c); }
.hwk-ag-info-card h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 7px; color: var(--hwk-primary, #1f3b57); }
.hwk-ag-info-card ul { margin: 0; padding-inline-start: 18px; }
.hwk-ag-info-card li { margin-bottom: 5px; font-size: 13.5px; line-height: 1.8; }

/* ===== بطاقة طلب الوكيل ===== */
.hwk-ag-request-head {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
}
.hwk-ag-request-no {
        font-size: 15px;
        color: var(--hwk-primary, #1f3b57);
        letter-spacing: 0.4px;
}
.hwk-ag-product-summary { display: flex; gap: 12px; align-items: flex-start; }
.hwk-ag-product-summary img,
.hwk-ag-product-thumb {
        width: 74px;
        height: 74px;
        object-fit: cover;
        border-radius: 12px;
        background: #eef1f5;
        flex-shrink: 0;
}
.hwk-ag-thumb-fallback { display: flex; align-items: center; justify-content: center; color: #8aa0b8; font-size: 24px; }
.hwk-ag-product-summary strong { font-size: 15px; display: block; margin-bottom: 3px; }
.hwk-ag-request-body { margin-bottom: 8px; }
.hwk-ag-request-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 9px;
        margin-top: 12px;
        padding-top: 13px;
        border-top: 1px dashed #e3e9f0;
}

/* ===== بطاقة الفحص ===== */
.hwk-ag-inspection-box {
        background: #f8fafc;
        border: 1px solid #e3e9f0;
        border-radius: 12px;
        padding: 14px 16px;
        margin-top: 12px;
}
.hwk-ag-inspection-box h5 { margin: 0 0 10px; font-size: 13.5px; font-weight: 800; color: var(--hwk-primary, #1f3b57); display: flex; gap: 6px; align-items: center; }
.hwk-ag-inspection-readonly { background: #fffdf7; }
.hwk-ag-upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hwk-ag-file-input { font-size: 12.5px; }
.hwk-ag-uploaded { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hwk-ag-file-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #eef2f7;
        border-radius: 8px;
        padding: 5px 11px;
        font-size: 12px;
        color: #1d4f8c;
        text-decoration: none !important;
}

/* ===== بطاقات المنتجات ===== */
.hwk-ag-product-card { display: flex; gap: 13px; align-items: flex-start; }
.hwk-ag-product-info { min-width: 0; flex: 1; }
.hwk-ag-product-info strong { display: block; margin-bottom: 3px; }

/* ===== بطاقات التسليم ===== */
.hwk-ag-delivery-info {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin: 10px 0;
}
.hwk-ag-delivery-info span { color: #5d6f82; font-weight: 700; }
.hwk-ag-otp-note {
        background: #fff7ec;
        border: 1px dashed #ffd9a3;
        border-radius: 10px;
        padding: 10px 14px;
        font-size: 13px;
        color: #8a5200;
        margin: 10px 0;
        display: flex;
        gap: 8px;
        align-items: flex-start;
        line-height: 1.8;
}
.hwk-ag-otp-input {
        font-size: 22px !important;
        font-weight: 900;
        letter-spacing: 8px;
        text-align: center;
}

/* ===== بطاقات kv ===== */
.hwk-ag-kv { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.hwk-ag-kv > div > span { color: #5d6f82; font-weight: 700; margin-inline-end: 5px; }

/* ===== الخريطة والموقع ===== */
.hwk-ag-locate-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 9px;
        align-items: center;
        margin: 0 0 13px;
}
.hwk-ag-locate-bar select {
        border: 1.5px solid #dfe6ee;
        border-radius: 10px;
        padding: 10px 13px;
        font-size: 14px;
        background: #fff;
        min-width: 200px;
}
.hwk-ag-map {
        height: 300px;
        border-radius: 14px;
        overflow: hidden;
        border: 1px solid #dfe6ee;
        background: #e8edf3;
        margin-bottom: 14px;
        z-index: 1; /* إبقاء الخريطة تحت النوافذ المنبثقة */
}
.hwk-ag-map-lg { height: 380px; }

.hwk-ag-agents-list { display: flex; flex-direction: column; gap: 11px; }
.hwk-ag-agent-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        background: #fff;
        border: 1px solid #dfe6ee;
        border-radius: 14px;
        padding: 15px 18px;
}
.hwk-ag-agent-info { flex: 1 1 220px; min-width: 0; }
.hwk-ag-agent-name { font-size: 15.5px; font-weight: 800; color: var(--hwk-primary, #1f3b57); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hwk-ag-agent-meta { font-size: 12.5px; color: #5d6f82; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.hwk-ag-agent-meta i { width: 15px; text-align: center; color: #8aa0b8; }
.hwk-ag-distance {
        background: #e5f6ec;
        color: #137a3e;
        font-weight: 800;
        border-radius: 999px;
        padding: 4px 13px;
        font-size: 12.5px;
        white-space: nowrap;
}

/* ===== النوافذ المنبثقة ===== */
.hwk-ag-modal {
        position: fixed;
        inset: 0;
        background: rgba(15, 26, 38, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 99999;
        padding: 18px;
}
.hwk-ag-modal[hidden] { display: none; }

/* [HWK-PROOF-FIX 1.4.3] إصلاح حرج: قاعدة الإخفاء كانت معرفة على سمة [hidden]
   بينما الكود يستخدم الصنف hidden — غيابها جعل النافذة وزر التأكيد ظاهرين
   دائمًا وحجبا الصفحة (زرّا عرض التفاصيل وإثبات الاستلام خلفها). */
.hwk-ag-modal.hidden { display: none !important; }
.hwk-ag-modal .hidden { display: none !important; }

/* [HWK-PROOF-FIX 1.4.3] تحسينات نافذة الإثبات/التفاصيل: قابلة للتمرير
   على الشاشات الصغيرة ومحاذاة النموذج لبداية السطر بدل التوسيط. */
.hwk-ag-modal { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hwk-ag-modal-box.hwk-ag-modal-form {
        text-align: start;
        max-width: 540px;
        max-height: calc(100vh - 36px);
        overflow-y: auto;
        padding: 22px 22px 18px;
}
.hwk-ag-modal-form .hwk-ag-modal-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin: -6px -4px 14px;
        position: sticky;
        top: -22px;
        background: #fff;
        padding: 12px 4px 10px;
        border-bottom: 1px solid #eef1f5;
        z-index: 2;
}
.hwk-ag-modal-form .hwk-ag-modal-title {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 16.5px;
        font-weight: 800;
        color: var(--hwk-primary, #1f3b57);
}
.hwk-ag-modal-form .hwk-ag-modal-close {
        border: 1px solid #dfe6ee;
        background: #fff;
        color: #5d6f82;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 15px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
}
.hwk-ag-modal-form .hwk-ag-modal-close:hover { background: #f2f6fb; color: #1f3b57; }
.hwk-ag-proof-summary {
        display: flex;
        align-items: center;
        gap: 9px;
        flex-wrap: wrap;
        background: #f2f6fb;
        border: 1px solid #dfe6ee;
        border-radius: 12px;
        padding: 10px 13px;
        font-size: 12.5px;
        color: #22303f;
        margin-bottom: 14px;
}
.hwk-ag-proof-summary strong { color: var(--hwk-primary, #1f3b57); }
.hwk-ag-proof-hint { font-size: 12px; color: #5d6f82; margin: -6px 0 12px; line-height: 1.8; }
.hwk-ag-attachments-list {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        margin-top: 8px;
}
.hwk-ag-attachments-list:empty { margin-top: 0; }
.hwk-ag-file-chip .fa-film { color: #7c3aed; }
.hwk-ag-details-kv {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        font-size: 13.5px;
        text-align: start;
}
.hwk-ag-details-kv > div {
        display: flex;
        gap: 8px;
        align-items: baseline;
        border-bottom: 1px dashed #eef1f5;
        padding-bottom: 7px;
}
.hwk-ag-details-kv > div:last-child { border-bottom: 0; }
.hwk-ag-details-kv span:first-child {
        color: #5d6f82;
        font-weight: 700;
        min-width: 118px;
        flex: 0 0 auto;
}
.hwk-ag-details-kv span:last-child { color: #22303f; word-break: break-word; }
.hwk-ag-details-section-title {
        font-size: 13px;
        font-weight: 800;
        color: var(--hwk-primary, #1f3b57);
        margin: 16px 0 8px;
        display: flex;
        align-items: center;
        gap: 7px;
}
.hwk-ag-modal-form .hwk-ag-modal-foot {
        display: flex;
        gap: 9px;
        justify-content: flex-start;
        flex-wrap: wrap;
        margin-top: 16px;
        padding-top: 14px;
        border-top: 1px solid #eef1f5;
        position: sticky;
        bottom: -18px;
        background: #fff;
}

/* [HWK-PROOF-FIX 1.4.3] رسائل حالة داخل النوافذ — كانت بلا أنماط */
.hwk-ag-msg { margin-top: 10px; font-size: 13px; font-weight: 700; min-height: 18px; text-align: start; }
.hwk-ag-msg.ok { color: #137a3e; }
.hwk-ag-msg.bad { color: #a02323; }
.hwk-ag-msg-ok,
.hwk-ag-msg-bad {
        display: block;
        border-radius: 10px;
        padding: 10px 13px;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.7;
}
.hwk-ag-msg-ok { background: #e5f6ec; color: #137a3e; border: 1px solid #bfe6cd; }
.hwk-ag-msg-bad { background: #fdecec; color: #a02323; border: 1px solid #f3c4c4; }
.hwk-ag-modal-box {
        background: #fff;
        border-radius: 18px;
        max-width: 430px;
        width: 100%;
        padding: 30px 28px;
        text-align: center;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.hwk-ag-modal-icon {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        margin: 0 auto 14px;
}
.hwk-ag-modal-icon.ok { background: #e5f6ec; color: #137a3e; }
.hwk-ag-modal-box h4 { margin: 0 0 8px; font-size: 19px; color: var(--hwk-primary, #1f3b57); }
.hwk-ag-modal-box p { margin: 0 0 8px; }
.hwk-ag-request-number-line strong {
        font-size: 20px;
        color: var(--hwk-primary, #1f3b57);
        letter-spacing: 1px;
}
.hwk-ag-modal-actions { display: flex; gap: 9px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ===== OTP للمستفيد ===== */
.hwk-ag-otp-box {
        background: linear-gradient(135deg, #fff7ec, #fffdf7);
        border: 2px solid var(--hwk-accent, #ff9f1c);
        border-radius: 14px;
        padding: 15px 18px;
        margin-top: 12px;
        text-align: center;
}
.hwk-ag-otp-label { font-size: 13px; font-weight: 700; color: #8a5200; margin-bottom: 7px; }
.hwk-ag-otp-value {
        font-size: 32px;
        font-weight: 900;
        letter-spacing: 10px;
        color: var(--hwk-primary, #1f3b57);
}

.hwk-ag-empty {
        background: #f8fafc;
        border: 1.5px dashed #d5dee8;
        border-radius: 14px;
        padding: 22px;
        text-align: center;
        color: #5d6f82;
        font-size: 14px;
}

/* ===== القوانين والأرشادات + عقد الالتزام والتوقيع ===== */

.hwk-ag-contract-page { display: flex; flex-direction: column; gap: 18px; }
.hwk-ag-contract-section { display: flex; flex-direction: column; gap: 10px; }
.hwk-ag-free-note { display: flex; gap: 10px; align-items: flex-start; }
.hwk-ag-free-note > div { flex: 1; }

/* بطاقات الفوائد */
.hwk-ag-benefits-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 12px;
}
.hwk-ag-benefit-card {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        background: #fff;
        border: 1px solid #e3eaf2;
        border-radius: 14px;
        padding: 14px;
        transition: box-shadow 0.15s, transform 0.15s;
}
.hwk-ag-benefit-card:hover {
        box-shadow: 0 6px 18px rgba(31, 59, 87, 0.08);
        transform: translateY(-2px);
}
.hwk-ag-benefit-icon {
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(255, 159, 28, 0.15), rgba(255, 159, 28, 0.05));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: var(--hwk-accent, #ff9f1c);
}
.hwk-ag-benefit-body strong { display: block; font-size: 13.5px; font-weight: 800; color: var(--hwk-primary, #1f3b57); margin-bottom: 4px; }
.hwk-ag-benefit-body p { margin: 0; font-size: 12.5px; line-height: 1.7; color: #5d6f82; }

/* مستند العقد */
.hwk-ag-contract-doc {
        background: #fff;
        border: 1px solid #e3eaf2;
        border-radius: 16px;
        padding: 22px 24px;
        box-shadow: 0 2px 10px rgba(31, 59, 87, 0.04);
}
.hwk-ag-contract-head {
        text-align: center;
        border-bottom: 2px solid #eef2f7;
        padding-bottom: 14px;
        margin-bottom: 16px;
}
.hwk-ag-contract-head h2 {
        margin: 0 0 10px;
        font-size: 21px;
        font-weight: 900;
        color: var(--hwk-primary, #1f3b57);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
}
.hwk-ag-contract-head h2 i { color: var(--hwk-accent, #ff9f1c); }
.hwk-ag-contract-meta {
        display: flex;
        gap: 16px;
        justify-content: center;
        flex-wrap: wrap;
        font-size: 12.5px;
        color: #5d6f82;
        font-weight: 700;
}
.hwk-ag-contract-meta i { color: var(--hwk-accent, #ff9f1c); }
.hwk-ag-contract-preamble p { margin: 0 0 10px; font-size: 13.5px; line-height: 2; color: #33465c; }
.hwk-ag-contract-free-banner {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        background: linear-gradient(135deg, #eafaf1, #f2fdf7);
        border: 1.5px solid #b8e6cd;
        border-radius: 14px;
        padding: 14px 16px;
        color: #166534;
        font-size: 13.5px;
        line-height: 1.9;
        margin: 14px 0;
}
.hwk-ag-contract-free-banner i { font-size: 20px; color: #16a34a; margin-top: 3px; }
.hwk-ag-contract-articles { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.hwk-ag-contract-article {
        background: #f8fafc;
        border: 1px solid #eef2f7;
        border-inline-start: 4px solid var(--hwk-primary, #1f3b57);
        border-radius: 12px;
        padding: 14px 16px;
}
.hwk-ag-contract-article h4 { margin: 0 0 8px; font-size: 14px; font-weight: 900; color: var(--hwk-primary, #1f3b57); }
.hwk-ag-contract-article ul { margin: 0; padding-inline-start: 18px; }
.hwk-ag-contract-article li { font-size: 13px; line-height: 1.95; color: #42566d; margin-bottom: 5px; }
.hwk-ag-contract-article li:last-child { margin-bottom: 0; }

/* خانة الإقرار والالتزام (تسجيل + توقيع) */
.hwk-ag-contract-consent { margin-top: 4px; }
.hwk-ag-sign-pledge {
        display: flex;
        gap: 10px;
        align-items: flex-start;
        background: #fffaf2;
        border: 1.5px solid #ffd9a3;
        border-radius: 12px;
        padding: 13px 15px;
        cursor: pointer;
        font-size: 12.8px;
        line-height: 1.9;
        color: #6b4a12;
}
.hwk-ag-sign-pledge input[type="checkbox"] {
        flex: 0 0 auto;
        width: 19px;
        height: 19px;
        margin-top: 3px;
        accent-color: var(--hwk-accent, #ff9f1c);
}
.hwk-ag-sign-pledge em { color: #8a6d3b; font-style: normal; font-size: 11.5px; }
.hwk-ag-consent-warn { color: #a02323; display: block; margin-top: 4px; }
.hwk-ag-contract-link { color: var(--hwk-primary, #1f3b57); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.hwk-ag-contract-link i { margin-inline-end: 4px; color: var(--hwk-accent, #ff9f1c); }

/* نموذج التوقيع الموثق */
.hwk-ag-sign-section .hwk-ag-sign-card { border: 2px solid var(--hwk-accent, #ff9f1c); }
.hwk-ag-sign-card > p { margin-top: 0; }
.hwk-ag-sign-grid { margin: 14px 0; }
.hwk-ag-sign-msg { margin-top: 10px; }
.hwk-ag-sign-msg.ok { color: #16a34a; font-weight: 800; }
.hwk-ag-sign-msg.bad { color: #a02323; font-weight: 800; }
.hwk-ag-contract-alert > div { flex: 1; }
.hwk-ag-contract-alert-btn { margin-top: 8px; display: inline-flex; }
.hwk-ag-count-warn {
        background: var(--hwk-accent, #ff9f1c);
        color: #fff;
        font-size: 10px;
        font-weight: 800;
        padding: 2px 8px;
}

/* بطاقة التوقيع المكتمل */
.hwk-ag-signed-card { border: 2px solid #b8e6cd; background: linear-gradient(135deg, #ffffff, #f4fdf8); }
.hwk-ag-signed-head { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hwk-ag-signed-card .hwk-ag-kv { width: 100%; border-collapse: collapse; }
.hwk-ag-signed-card .hwk-ag-kv th, .hwk-ag-signed-card .hwk-ag-kv td {
        text-align: start;
        padding: 8px 10px;
        border-bottom: 1px solid #eef2f7;
        font-size: 13px;
}
.hwk-ag-signed-card .hwk-ag-kv th { color: #5d6f82; font-weight: 700; width: 150px; }
.hwk-ag-signed-card .hwk-ag-kv td { color: #22303f; font-weight: 600; }
.hwk-ag-signed-note { margin: 12px 0 0; font-size: 12px; }
.hwk-ag-signed-note i { color: #16a34a; }

/* دعوة التسجيل أسفل صفحة العقد */
.hwk-ag-contract-cta {
        text-align: center;
        background: #f8fafc;
        border: 1.5px dashed #c9d6e4;
        border-radius: 16px;
        padding: 22px;
}
.hwk-ag-contract-cta p { margin: 0 0 14px; color: #33465c; font-size: 14px; font-weight: 600; }

/* جدول بيانات عام داخل الواجهة الأمامية (للعقد) */
.hwk-ag-contract-page .hwk-ag-kv { width: 100%; border-collapse: collapse; }
.hwk-ag-contract-page .hwk-ag-kv th, .hwk-ag-contract-page .hwk-ag-kv td {
        text-align: start;
        padding: 8px 10px;
        border-bottom: 1px solid #eef2f7;
        font-size: 13px;
}
.hwk-ag-contract-page .hwk-ag-kv th { color: #5d6f82; font-weight: 700; width: 150px; }

/* ===== تجاوب الجوال ===== */
@media (max-width: 640px) {
        .hwk-ag-form-grid { grid-template-columns: 1fr; }
        .hwk-ag-cards-grid { grid-template-columns: 1fr; }
        .hwk-ag-stats-grid { grid-template-columns: repeat(2, 1fr); }
        .hwk-ag-welcome { flex-direction: column; align-items: flex-start; }
        .hwk-ag-welcome-stats { width: 100%; }
        .hwk-ag-welcome-stats > div { flex: 1; }
        .hwk-ag-product-summary img, .hwk-ag-product-thumb { width: 60px; height: 60px; }
        .hwk-ag-otp-value { font-size: 26px; letter-spacing: 7px; }
        .hwk-ag-request-actions .hwk-ag-btn { width: 100%; }
        .hwk-ag-map-lg { height: 280px; }
        .hwk-ag-table { font-size: 12.5px; }
        .hwk-ag-table thead th, .hwk-ag-table td { padding: 8px; }
}

/* ==================================================================
 * نظام مكافآت الوكلاء — محفظة نقاط الوكيل وجدول النقاط والترتيب
 * نقاط منصة غير نقدية — مصطلحات: نقاطك، مكافآتك، إنجازاتك، مستواك
 * ================================================================== */

/* جدول النقاط */
.hwk-ag-pts-table-wrap { direction: rtl; }
.hwk-ag-pts-table-title { margin: 0 0 12px; font-size: 16px; color: #1f3b57; }
.hwk-ag-pts-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3eaf2; border-radius: 10px; overflow: hidden; }
.hwk-ag-pts-table thead th { background: #1f3b57; color: #fff; padding: 10px 14px; font-size: 13.5px; text-align: right; }
.hwk-ag-pts-table tbody td { padding: 12px 14px; border-top: 1px solid #eef2f7; vertical-align: top; }
.hwk-ag-pts-table tbody tr:nth-child(even) { background: #fafbfd; }
.hwk-ag-pts-activity { font-weight: 600; color: #22303f; display: block; }
.hwk-ag-pts-activity i { color: #ff9f1c; margin-inline-end: 6px; }
.hwk-ag-pts-desc { display: block; color: #7a8798; font-size: 12px; margin-top: 3px; line-height: 1.6; }
.hwk-ag-pts-value { font-weight: 800; color: #16a34a; font-size: 16px; white-space: nowrap; direction: ltr; text-align: center; }
.hwk-ag-pts-note { margin: 10px 0 0; font-size: 12px; color: #7a8798; line-height: 1.8; }
.hwk-ag-pts-note i { color: #ff9f1c; margin-inline-end: 4px; }

/* بطاقة الرصيد الرئيسية */
.hwk-ag-wallet { direction: rtl; }
.hwk-ag-wallet-hero { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #1f3b57, #2c527a); color: #fff; border-radius: 16px; padding: 22px 24px; margin-bottom: 14px; }
.hwk-ag-wallet-balance-label { display: block; font-size: 13px; opacity: 0.85; margin-bottom: 4px; }
.hwk-ag-wallet-balance strong { font-size: 38px; font-weight: 800; line-height: 1; }
.hwk-ag-wallet-balance-unit { font-size: 14px; opacity: 0.85; margin-inline-start: 6px; }
.hwk-ag-wallet-level-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; opacity: 0.95; }
.hwk-ag-wallet-level-meta i { margin-inline-end: 4px; color: #ffd166; }

/* شريط التقدم */
.hwk-ag-progress-card { margin-bottom: 14px; }
.hwk-ag-progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13.5px; color: #22303f; }
.hwk-ag-progress { height: 12px; background: #edf1f6; border-radius: 999px; overflow: hidden; }
.hwk-ag-progress-bar { height: 100%; border-radius: 999px; transition: width 0.4s ease; min-width: 4px; }

/* إحصاءات المحفظة */
.hwk-ag-wallet-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.hwk-ag-wallet-stat { background: #fff; border: 1px solid #e3eaf2; border-radius: 12px; padding: 14px 12px; text-align: center; }
.hwk-ag-wallet-stat strong { display: block; font-size: 20px; color: #1f3b57; margin-bottom: 4px; }
.hwk-ag-wallet-stat span { font-size: 11.5px; color: #7a8798; }

/* مزايا المستوى */
.hwk-ag-perks-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.hwk-ag-perks-list li { background: #f6f9fc; border: 1px solid #e3eaf2; border-radius: 8px; padding: 9px 12px; font-size: 13px; color: #22303f; }
.hwk-ag-perks-list li i { color: #16a34a; margin-inline-end: 6px; }

/* بطاقات المكافآت */
.hwk-ag-rewards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.hwk-ag-reward-card { background: #fff; border: 1px solid #e3eaf2; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.hwk-ag-reward-card strong { color: #1f3b57; font-size: 15px; }
.hwk-ag-reward-card p { margin: 0; font-size: 12.5px; color: #7a8798; line-height: 1.7; flex: 1; }
.hwk-ag-reward-cost { font-size: 18px; font-weight: 800; color: #ff9f1c; direction: ltr; text-align: right; }
.hwk-ag-reward-cost small { font-size: 11px; color: #7a8798; font-weight: 400; }
.hwk-ag-reward-locked { opacity: 0.62; }

/* الإنجازات */
.hwk-ag-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.hwk-ag-ach { text-align: center; border: 1px solid #e3eaf2; border-radius: 12px; padding: 14px 8px; background: #fff; }
.hwk-ag-ach i { font-size: 24px; color: #ff9f1c; display: block; margin-bottom: 6px; }
.hwk-ag-ach strong { display: block; font-size: 12.5px; color: #22303f; }
.hwk-ag-ach span { font-size: 10.5px; color: #7a8798; }
.hwk-ag-ach-locked { opacity: 0.45; filter: grayscale(0.7); }
.hwk-ag-ach-earned { border-color: #ffd166; box-shadow: 0 2px 10px rgba(255, 159, 28, 0.12); }

/* الإحالات */
.hwk-ag-referral-row { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.hwk-ag-referral-row input { flex: 1; min-width: 220px; border: 1px solid #dfe6ee; border-radius: 8px; padding: 9px 12px; font-size: 13px; background: #fafbfc; direction: ltr; text-align: left; }

/* سجل النقاط */
.hwk-ag-ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
.hwk-ag-ledger th { background: #f6f9fc; color: #22303f; padding: 9px 10px; text-align: right; font-size: 12px; border-bottom: 1px solid #e3eaf2; }
.hwk-ag-ledger td { padding: 10px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.hwk-ag-pos { color: #16a34a; }
.hwk-ag-neg { color: #dc3545; }
.hwk-ag-badge-pending { background: #fff3cd; color: #8a6d00; }
.hwk-ag-badge-approved { background: #d1fae5; color: #0b6e4f; }
.hwk-ag-badge-cancelled { background: #fde8e8; color: #b02a37; }
.hwk-ag-badge-expired { background: #e9ecef; color: #495057; }
.hwk-ag-ledger-pager { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

/* الترتيب */
.hwk-ag-ranking-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hwk-ag-ranking-table th { background: #1f3b57; color: #fff; padding: 9px 10px; text-align: right; font-size: 12px; }
.hwk-ag-ranking-table td { padding: 10px; border-bottom: 1px solid #eef2f7; }
.hwk-ag-ranking-me { background: #fff8e6; }
.hwk-ag-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 50%; background: #edf1f6; color: #22303f; font-weight: 700; font-size: 12.5px; }
.hwk-ag-rank-1 { background: #ffd166; color: #6b4d00; }
.hwk-ag-rank-2 { background: #e2e8f0; color: #475569; }
.hwk-ag-rank-3 { background: #f6c8a0; color: #7c4a12; }
.hwk-ag-star { color: #ffb703; }

/* تنبيهات عائمة (توست) */
.hwk-ag-points-toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%) translateY(20px); background: #1f3b57; color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 99999; max-width: 90vw; text-align: center; }
.hwk-ag-points-toast.show { opacity: 1; transform: translateX(50%) translateY(0); }
