    /* ===== المرحلة 3: الإشعارات + وضع المعرض السريع + تظليل الـ AI + المراجعة ===== */
    .btn-quick { background: #f59e0b; color: #1f2937; font-weight: 800; }
    .notif-wrap { position: relative; }
    .notif-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3);
      background: rgba(255,255,255,0.15); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
    .notif-btn:hover { background: rgba(255,255,255,0.28); }
    .notif-btn svg { width: 20px; height: 20px; }
    .notif-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
      background: #e11d48; color: #fff; font-size: 11px; font-weight: 800; display: none; align-items: center; justify-content: center;
      border: 2px solid #1a234e; box-sizing: border-box; line-height: 1; }
    .notif-badge.show { display: inline-flex; }
    .notif-badge.pulse { animation: notifPulse 1.1s ease-out 3; }
    @keyframes notifPulse { 0% { box-shadow: 0 0 0 0 rgba(225,29,72,0.75); } 100% { box-shadow: 0 0 0 12px rgba(225,29,72,0); } }
    .notif-panel { display: none; position: absolute; right: 0; top: 48px; width: 370px; max-width: 92vw; background: #fff; color: #0f172a;
      border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,0.28); border: 1px solid #e2e8f0; z-index: 3000; overflow: hidden; text-align: left; }
    .notif-panel.open { display: block; }
    .notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #e2e8f0; font-weight: 800; color: #1a234e; }
    .notif-head button { background: none; border: none; color: #2563eb; font-size: 12px; font-weight: 700; cursor: pointer; }
    .notif-list { max-height: 420px; overflow-y: auto; }
    .notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
    .notif-item:hover { background: #f8fafc; }
    .notif-item.unread { background: #eff6ff; }
    .notif-avatar { flex: 0 0 36px; height: 36px; border-radius: 50%; background: #1a234e; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
    .notif-body { flex: 1; font-size: 13px; line-height: 1.4; color: #334155; }
    .notif-time { font-size: 11px; color: #64748b; margin-top: 2px; }
    .notif-dot { width: 10px; height: 10px; border-radius: 50%; background: #2563eb; margin-top: 6px; flex: 0 0 10px; }
    .notif-empty { padding: 26px 14px; text-align: center; color: #64748b; font-size: 13px; }
    @media (max-width: 600px) { .notif-panel { position: fixed; left: 8px; right: 8px; top: 70px; width: auto; max-width: none; } }

    .quick-toggle { border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 800; cursor: pointer; }
    .quick-toggle.on { background: #f59e0b; color: #1f2937; border-color: #f59e0b; }
    #addModal.quick-mode .form-grid > .form-group:not([data-quick]) { display: none; }
    #addModal.quick-mode .modal { border-top-color: #f59e0b; }

    .form-group.ai-filled input, .form-group.ai-filled select, .form-group.ai-filled textarea, .form-group.ai-filled .checkbox-group {
      background: #f5f3ff; border-color: #a78bfa; box-shadow: 0 0 0 2px rgba(167,139,250,0.18); }
    .form-group.ai-filled > label:first-child::after { content: '\2728 AI'; margin-left: 6px; font-size: 10px; font-weight: 800; color: #6d28d9; background: #ede9fe; padding: 1px 6px; border-radius: 8px; }
    .ai-legend { display: none; margin: 10px 0 0; padding: 8px 12px; background: #f5f3ff; border: 1px solid #ddd6fe; color: #5b21b6;
      border-radius: 10px; font-size: 12px; font-weight: 600; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
    .ai-legend.show { display: flex; }

    .badge-review { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
    .badge-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
    .btn-reviewed { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }
    .btn.active-filter { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
    .count-pill { background: #e11d48; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: 6px; font-weight: 800; }
    .review-toggle label { display: flex; gap: 8px; align-items: center; background: #fff7ed; border: 1px solid #fed7aa; padding: 9px 12px;
      border-radius: 10px; font-size: 13px; font-weight: 700; color: #9a3412; cursor: pointer; margin: 0; }
    .review-toggle input { width: auto; }
    .filters { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto auto auto; }
    @media (max-width: 1100px) { .filters { grid-template-columns: 1fr 1fr; } }
    @media (max-width: 600px) { .filters { grid-template-columns: 1fr; } }
  
    /* ===== المرحلة 3: الجرس الأحمر + شريط الجدول بخط Times New Roman ===== */
    .notif-btn { transition: background-color 0.2s, border-color 0.2s, transform 0.2s; }
    .notif-btn.has-new { background: #e11d48; border-color: #fecdd3; color: #fff; box-shadow: 0 0 0 3px rgba(225,29,72,0.28); }
    .notif-btn.has-new:hover { background: #be123c; }
    .notif-btn.has-new svg { animation: bellShake 0.9s ease-in-out 2; transform-origin: 50% 8%; }
    @keyframes bellShake { 0%,100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
    .notif-btn.has-new .notif-badge { background: #fff; color: #e11d48; border-color: #e11d48; }

    /* وضع الجدول: خط Times New Roman + شريط أسهم فقط */
    #tableWrapper, #tableWrapper * { font-family: "Times New Roman", Times, serif !important; }
    #tableWrapper .vendors-table { font-size: 14px; }
    .table-scroll-controls { justify-content: flex-end !important; padding: 6px 12px !important; }
    .scroll-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #cbd5e1; background: #fff; color: #1a234e; cursor: pointer;
      display: inline-flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 1px 2px rgba(16,22,54,0.08); transition: background-color 0.15s, transform 0.1s; }
    .scroll-arrow:hover { background: #1a234e; color: #fff; }
    .scroll-arrow:active { transform: scale(0.92); }
    .scroll-arrow svg { width: 18px; height: 18px; }
    .table-scroll-container { cursor: grab; }
    .table-scroll-container.dragging { cursor: grabbing; user-select: none; scroll-behavior: auto; }
  
    /* ===== ملخص نهاية اليوم لوضع السريع ===== */
    .quick-digest-bar { display: none; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 9px 12px;
      background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: #92400e; }
    #addModal.quick-mode .quick-digest-bar { display: flex; }
    .quick-digest-bar .btn { padding: 5px 12px; font-size: 12px; }
  
    /* ===== المرحلة 4: PWA + الطابور ===== */
    .offline-bar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 400; background: #b45309; color: #fff; text-align: center;
      font-size: 12.5px; font-weight: 700; padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top, 0px)); }
    .offline-bar.show { display: block; }
    body.is-offline header { margin-top: 30px; }
    .queue-btn { position: relative; gap: 6px; align-items: center; background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
    .queue-btn .q-count { background: #fff; color: #1a234e; border-radius: 999px; min-width: 20px; padding: 0 6px; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
    .queue-btn.attention { background: #f59e0b; border-color: #fde68a; color: #1f2937; }
    #saveLaterBtn { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
    .q-modal { max-width: 640px; }
    .q-help { font-size: 12px; color: #64748b; margin: 0 0 12px; }
    .q-empty { text-align: center; padding: 28px 10px; color: #166534; font-weight: 700; }
    .q-item { display: flex; gap: 12px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 10px; background: #fff; }
    .q-thumb { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 10px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; }
    .q-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .q-main { flex: 1; min-width: 0; }
    .q-title { font-weight: 800; color: var(--primary); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .q-meta { font-size: 11.5px; color: #64748b; margin-top: 2px; }
    .q-chip { font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px; }
    .q-wait { background: #e0f2fe; color: #075985; } .q-busy { background: #ede9fe; color: #5b21b6; }
    .q-warn { background: #fef3c7; color: #92400e; } .q-bad { background: #fee2e2; color: #991b1b; }
    .q-note { font-size: 12px; color: #7c2d12; background: #fff7ed; border-radius: 8px; padding: 6px 9px; margin-top: 6px; }
    .q-inline { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
    .q-inline input { flex: 1; min-width: 130px; padding: 8px 10px; }
    .q-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
    .q-actions .btn { padding: 6px 12px; font-size: 12px; }
    .q-del { color: #b91c1c; margin-left: auto; }
  
    /* ===== المرحلة 5: ترتيب + فلاتر إضافية + تحميل على دفعات ===== */
    .toolbar2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
    .results-info { font-size: 13px; font-weight: 700; color: #475569; }
    .toolbar2-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .sort-label { font-size: 12px; font-weight: 700; color: #64748b; }
    .toolbar2 select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; }
    .more-filters { display: none; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
    .more-filters.open { display: block; }
    .mf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
    .mf-grid select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; width: 100%; }
    .mf-actions { margin-top: 10px; text-align: right; }
    .load-more-bar { text-align: center; margin: 18px 0 28px; }
  
    /* ===== المرحلة 6: Insights ===== */
    .insights { margin: 14px 0; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 2px rgba(16,22,54,.04), 0 6px 18px rgba(16,22,54,.05); }
    .insights > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 700; color: var(--primary); }
    .insights > summary::-webkit-details-marker { display: none; }
    .insights > summary small { font-weight: 500; color: var(--muted); }
    .ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; padding: 0 16px 16px; }
    .ins-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; min-width: 0; }
    .ins-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
    .ins-row { display: grid; grid-template-columns: minmax(70px, 36%) 1fr auto; gap: 8px; align-items: center; padding: 3px 0; font-size: 12px; cursor: pointer; }
    .ins-row:hover .ins-label { color: var(--primary); text-decoration: underline; }
    .ins-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
    .ins-track { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
    .ins-bar { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
    .ins-donut { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
    .ins-total { font-size: 9px; font-weight: 700; fill: var(--primary); }
    .ins-leg { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; cursor: pointer; }
    .ins-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
    .ins-leg b { margin-inline-start: auto; padding-inline-start: 12px; }
    .ins-empty { color: var(--muted); font-size: 12px; padding: 8px 0; }

    /* ===== Compact layout v4: KPI strip + slim header (more room for vendor cards) ===== */
    header { padding: 8px 16px !important; gap: 8px 14px !important; }
    header .brand-logo-box { padding: 4px 9px !important; border-radius: 10px !important; }
    header .brand-logo-box img { height: 34px !important; width: auto !important; max-height: 34px !important; }
    header h1 { font-size: 17px !important; line-height: 1.2 !important; margin: 0 !important; }
    header p { font-size: 11px !important; margin: 2px 0 0 !important; }
    header .header-left { gap: 10px !important; }
    header .header-actions { gap: 6px !important; }
    header .header-actions .btn { padding: 6px 11px !important; font-size: 12px !important; }
    .container { margin-top: 10px !important; }
    .dashboard-title-bar { padding: 7px 14px !important; margin-bottom: 8px !important; font-size: 13px !important; }
    .kpi-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 8px 0 10px; }
    .kpi-strip .kpis { display: contents; }
    .kpi-strip .kpi-section-title { display: none; }
    .kpi-strip .kpi { padding: 8px 12px !important; border-radius: 10px !important; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; margin: 0; }
    .kpi-strip .kpi .label { font-size: 11.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 !important; }
    .kpi-strip .kpi .val { font-size: 20px !important; line-height: 1 !important; margin: 0 !important; }
    .kpi-strip .kpi[onclick*="'High'"] { margin-inline-start: 6px; }
    .insights { margin: 8px 0 10px !important; }
    .insights > summary { padding: 8px 14px !important; }
    @media (max-width: 900px) {
      .kpi-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
      .kpi-strip .kpi { flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 9px !important; }
      .kpi-strip .kpi .label { font-size: 10px !important; }
      .kpi-strip .kpi .val { font-size: 18px !important; }
      .kpi-strip .kpi[onclick*="'High'"] { margin-inline-start: 0; }
    }

    /* sort + results bar on one line */
    .toolbar2 { display: flex !important; align-items: center !important; justify-content: space-between !important; flex-wrap: wrap !important; gap: 8px 12px !important; margin: 2px 0 10px !important; }
    .toolbar2-right { display: flex !important; align-items: center !important; gap: 8px !important; flex-wrap: wrap !important; }
    .toolbar2-right .sort-label { margin: 0 !important; }
    .toolbar2-right select { width: auto !important; min-width: 170px; padding-top: 7px; padding-bottom: 7px; }
    .toolbar2-right .btn { padding: 7px 12px !important; font-size: 12px !important; }

    @media (max-width: 700px) {
      header { padding: 8px 12px !important; }
      header .header-left p { display: none !important; }
      header h1 { font-size: 15px !important; }
      header .brand-logo-box img { height: 24px !important; max-height: 24px !important; }
      header .header-actions .btn { padding: 6px 9px !important; font-size: 11px !important; }
      .dashboard-title-bar { display: none !important; }
      .filters { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; padding: 10px !important; }
      .filters #searchInput { grid-column: 1 / -1; }
      .filters select, .filters .btn { width: 100% !important; min-width: 0 !important; padding: 8px 10px !important; font-size: 13px !important; }
    }


    /* ===== المرحلة 7: تذكيرات المتابعة ===== */
    .fu-banner { display: none; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 12px;
      background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; }
    .fu-banner.show { display: flex; }
    .fu-banner-title { font-size: 12.5px; font-weight: 800; color: #92400e; margin-inline-end: 4px; }
    .fu-chip { border: 1px solid #e2e8f0; background: #fff; color: #334155; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
    .fu-chip:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(16,22,54,.10); }
    .fu-chip b { font-weight: 800; margin-inline-start: 4px; }
    .fu-chip.over { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }
    .fu-chip.today { color: #c2410c; border-color: #fdba74; background: #fff7ed; }
    .fu-chip.soon { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
    .fu-chip.active { outline: 2px solid #0d47a1; outline-offset: 1px; }
    .badge-fu-over { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
    .badge-fu-today { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
    .badge-fu-soon { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
    .badge-fu-later { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
    .fu-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 10px 0 4px; padding: 8px 10px; border-radius: 10px; border: 1px solid #e2e8f0; background: #f8fafc; }
    .fu-row.fu-over { background: #fef2f2; border-color: #fecaca; }
    .fu-row.fu-today { background: #fff7ed; border-color: #fed7aa; }
    .fu-row.fu-soon { background: #eff6ff; border-color: #dbeafe; }
    .fu-row-main { display: flex; gap: 8px; min-width: 0; font-size: 12.5px; color: #334155; }
    .fu-when strong { color: #0f172a; }
    .fu-note { margin-top: 2px; color: #475569; word-break: break-word; }
    .fu-owner { margin-top: 2px; font-size: 11px; color: #64748b; }
    .fu-row-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
    .fu-row-actions .btn { padding: 4px 9px; font-size: 11px; }
    .fu-box { margin-top: 6px; padding: 12px; border: 1px solid #fde68a; background: #fffbeb; border-radius: 12px; }
    .fu-box-title { font-size: 13px; font-weight: 800; color: #92400e; margin-bottom: 8px; }
    .fu-date-row { display: flex; gap: 8px; align-items: center; }
    .fu-date-row input { flex: 1; }
    .fu-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
    .fu-chips button { border: 1px solid #fcd34d; background: #fff; color: #92400e; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
    .fu-chips button:hover { background: #fef3c7; }
    .fu-box input[type=text] { width: 100%; }
    .fu-meta { margin-top: 6px; font-size: 11.5px; color: #78350f; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .fu-meta .btn { padding: 3px 9px; font-size: 11px; }

