/* سجل المرتجعات (/reports/returns) — منقول حرفيًا من <style> بـlogs/returns-log.html (Legacy) بتحويل آلي
   (port_legacy_css.py، نفس طريقة stocktake-legacy.css): كل محدِّد مقيَّد بـ.rl-root، :root/html[data-theme=light]
   → .rl-root/[data-theme=light] .rl-root، وأسماء @keyframes بادئة rl- (تعريفا slideUp المكرران بالـLegacy
   بقيا بنفس الترتيب — الثاني يغلب، زي المتصفح). الإضافات الخاصة بـV2 في آخر الملف. */
/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES & TOKENS
═══════════════════════════════════════════════════════════════ */
.rl-root {
    --bg-card:      rgba(var(--th-n-900-rgb),0.52);
    --bg-input:     rgba(255,255,255,0.05);
    --bg-hover:     rgba(255,255,255,0.07);
    --border:       rgba(255,255,255,0.08);
    --border-focus: rgba(var(--th-accent-500-rgb),0.7);
    --text:         var(--th-n-200);
    --text-muted:   var(--th-n-500);
    --text-sub:     var(--th-n-400);
    --ret:          #ef4444;
    --ret-2:        #f97316;
    --success:      #10b981;
    --danger:       #ef4444;
    --warn:         #f59e0b;
    --info:         #3b82f6;
    --radius:       14px;
    --card-border:  rgba(255,255,255,0.07);
    --dur-fast:     170ms;
    --dur-med:      280ms;
}

[data-theme="light"] .rl-root {
    --bg-card:      rgba(255,255,255,0.90);
    --bg-input:     rgba(var(--th-n-900-rgb),0.04);
    --bg-hover:     rgba(59,130,246,0.05);
    --border:       rgba(var(--th-n-900-rgb),0.09);
    --border-focus: rgba(var(--th-accent-500-rgb),0.55);
    --text:         var(--th-n-800);
    --text-muted:   var(--th-n-500);
    --text-sub:     var(--th-n-600);
    --card-border:  rgba(var(--th-n-900-rgb),0.08);
    --ret:          #dc2626;
    --ret-2:        #ea580c;
}

.rl-root * { box-sizing: border-box; margin: 0; padding: 0; }
.rl-root { height: 100%; overflow: hidden; }
.rl-root { font-family: 'Cairo', sans-serif; background: transparent; color: var(--text); display: flex; flex-direction: column; height: 100%; }

/* ═══════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════ */
.rl-root .panel-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--border);
    flex-shrink: 0; position: relative;
}

.rl-root .panel-header::after {
    content: ''; position: absolute; bottom: 0; right: 0; left: 0; height: 1px;
    background: linear-gradient(90deg, var(--ret), var(--ret-2), transparent);
    opacity: 0.35;
}

.rl-root .panel-header-right { display: flex; align-items: center; gap: 13px; }
.rl-root .panel-icon {
    width: 44px; height: 44px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    background: linear-gradient(135deg, var(--ret), var(--ret-2));
    box-shadow: 0 4px 18px rgba(239,68,68,.42), 0 0 0 1px rgba(255,255,255,.14) inset;
}
.rl-root .panel-icon svg { width: 20px; height: 20px; color: #fff; }
.rl-root .panel-title { font-size: 17px; font-weight: 900; color: var(--text); padding-right: 30px; }
.rl-root .panel-subtitle { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.rl-root .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 6px var(--danger); flex-shrink: 0; animation: rl-pulseDot 2.2s ease-in-out infinite; }
@keyframes rl-pulseDot { 0%,100% { box-shadow: 0 0 4px var(--danger); } 50% { box-shadow: 0 0 10px var(--danger); } }

.rl-root .panel-header-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rl-root .header-date-badge { display: flex; align-items: center; gap: 6px; background: var(--bg-input); border: 1px solid var(--card-border); border-radius: 10px; padding: 6px 12px; font-size: 11px; font-weight: 700; color: var(--text-sub); white-space: nowrap; }
.rl-root .header-date-badge svg { width: 12px; height: 12px; color: var(--text-muted); flex-shrink: 0; }
.rl-root .header-refresh-btn { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border: 1px solid var(--card-border); color: var(--text-muted); cursor: pointer; transition: all var(--dur-fast); flex-shrink: 0; }
.rl-root .header-refresh-btn:hover { background: var(--bg-hover); color: var(--ret); border-color: rgba(239,68,68,.5); }
.rl-root .header-refresh-btn.spinning svg { animation: rl-spin 0.6s linear infinite; }
@keyframes rl-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   KPI STRIP
═══════════════════════════════════════════════════════════════ */
.rl-root .kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 12px 16px 10px; flex-shrink: 0; }
.rl-root .kpi-card { background: var(--bg-card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 11px 13px; display: flex; flex-direction: column; gap: 4px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); position: relative; overflow: hidden; transition: border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast); }
.rl-root .kpi-card:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.rl-root .kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; border-radius: 99px 99px 0 0; }
.rl-root .kpi-card.c-red::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.rl-root .kpi-card.c-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.rl-root .kpi-card.c-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.rl-root .kpi-card.c-purple::before { background: linear-gradient(90deg, var(--th-accent-500), var(--th-accent2-500)); }
.rl-root .kpi-card.c-orange::before { background: linear-gradient(90deg, #f97316, #fb923c); }
.rl-root .kpi-header { display: flex; align-items: center; justify-content: space-between; }
.rl-root .kpi-label { font-size: 10.5px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; }
.rl-root .kpi-icon { width: 27px; height: 27px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rl-root .kpi-icon svg { width: 13px; height: 13px; }
.rl-root .c-red .kpi-icon { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.rl-root .c-amber .kpi-icon { background: rgba(245, 158, 11, 0.12); color: var(--warn); }
.rl-root .c-blue .kpi-icon { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.rl-root .c-purple .kpi-icon { background: rgba(var(--th-accent-500-rgb), 0.14); color: var(--th-accent-500); }
.rl-root .c-orange .kpi-icon { background: rgba(249, 115, 22, 0.14); color: #f97316; }
.rl-root .kpi-value { font-size: 18px; font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; }
.rl-root .kpi-sub { font-size: 10px; color: var(--text-muted); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   TABLE CONTAINER
═══════════════════════════════════════════════════════════════ */
.rl-root .table-wrapper { flex: 1; overflow: auto; padding: 8px 16px 0; position: relative; }
.rl-root .table-wrapper::-webkit-scrollbar { width: 5px; }
.rl-root .table-wrapper::-webkit-scrollbar-track { background: transparent; }
.rl-root .table-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 99px; }

/* ═══════════════════════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════════════════════ */
/* min-width = مجموع أقل عرض لكل عمود حسب نوع محتواه (معيار موحّد لكل
   جداول السجلات في المشروع — لو ضفت/شلت عمود عدّل الرقم بنفس المنطق):
   رقم تسلسلي/إجراء مفرد 45-50px · Badge/حالة قصيرة 85px ·
   اسم/رقم/مبلغ قياسي 95px · تاريخ+وقت مجتمعين 110px ·
   عميل مع صورة رمزية 115px · نص حر طويل (وصف/سبب) 155px.
   الأعمدة هنا: رقم المرتجعة 95 + كاشير 95 + عميل 95 + تاريخ+وقت 110 +
   فاتورة أصلية 95 + سبب الإرجاع[نص حر] 155 + طريقة الاسترداد[Badge] 85 +
   أصناف 85 + مبلغ مرتجع 95 = 910 */
.rl-root .returns-table { width: 100%; min-width: 910px; border-collapse: separate; border-spacing: 0 3px; font-size: 12.5px; }
.rl-root .returns-table thead th { padding: 7px 11px; text-align: right; font-size: 10px; font-weight: 800; letter-spacing: 0.07em; color: var(--text-muted); text-transform: uppercase; white-space: nowrap; position: sticky; top: 0; z-index: 5; background: rgba(8, 12, 26, 0.90); backdrop-filter: blur(16px); }
.rl-root .returns-table tbody tr { cursor: pointer; }
.rl-root .returns-table tbody tr td { padding: 9px 11px; background: var(--bg-card); border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); transition: background var(--dur-fast); white-space: nowrap; vertical-align: middle; }
.rl-root .returns-table tbody tr:hover td { background: rgba(239, 68, 68, 0.07); }

/* ═══════════════════════════════════════════════════════════════
   TABLE CELLS
═══════════════════════════════════════════════════════════════ */
.rl-root .cell-id { font-size: 11px; font-weight: 800; color: var(--ret); letter-spacing: 0.03em; display: flex; align-items: center; gap: 4px; }
.rl-root .cell-id svg { width: 10px; height: 10px; opacity: 0.7; }
.rl-root .cell-user { font-weight: 700; color: var(--text-sub); font-size: 12px; }
.rl-root .cell-customer { display: flex; align-items: center; gap: 7px; }
.rl-root .cell-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--ret), var(--ret-2)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 10.5px; flex-shrink: 0; }
.rl-root .cell-date { color: var(--text-sub); font-size: 11.5px; }
.rl-root .cell-time { font-size: 10px; color: var(--text-muted); display: block; margin-top: 2px; }
.rl-root .cell-amount { font-weight: 900; font-size: 13px; color: var(--ret); }
.rl-root .cell-muted { color: var(--text-muted); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════════ */
.rl-root .badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; flex-shrink: 0; }
.rl-root .badge svg { width: 10px; height: 10px; }
.rl-root .badge-cash { background: rgba(16, 185, 129, 0.16); color: var(--success); }
.rl-root .badge-credit { background: rgba(var(--th-accent-500-rgb), 0.16); color: var(--th-accent-500); }
.rl-root .reason-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--warn); background: rgba(245, 158, 11, 0.12); border-radius: 5px; padding: 1px 6px; }
.rl-root .reason-chip svg { width: 10px; height: 10px; }

/* ═══════════════════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════════════════ */
.rl-root .tabs-bar { display: flex; align-items: center; gap: 0; padding: 0 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.rl-root .tab { padding: 10px 16px; font-size: 12px; font-weight: 700; color: var(--text-muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; transition: all var(--dur-fast); position: relative; display: flex; align-items: center; gap: 6px; }
.rl-root .tab:hover { color: var(--text-sub); }
.rl-root .tab.active { color: var(--ret); border-bottom-color: var(--ret); }
.rl-root .tab svg { width: 14px; height: 14px; }

.rl-root .tab-content { display: none; flex: 1; overflow-y: auto; }
.rl-root .tab-content.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   MODAL OVERLAY & MODAL
═══════════════════════════════════════════════════════════════ */
.rl-root .modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.65); display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); padding: 20px; }
.rl-root .modal-overlay.open { display: flex; animation: rl-fadeIn 0.3s ease both; }
@keyframes rl-fadeIn { from { opacity: 0; } to { opacity: 1; } }

.rl-root .modal { background: rgba(10, 14, 30, 0.97); border: 1px solid var(--card-border); border-radius: 20px; width: 100%; max-width: 660px; max-height: calc(90 * var(--vh)); overflow-y: auto; display: flex; flex-direction: column; box-shadow: 0 32px 80px rgba(0,0,0,.55); animation: rl-slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes rl-slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.rl-root .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.rl-root .modal-title-row { display: flex; align-items: center; gap: 10px; }
.rl-root .modal-icon { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--ret), var(--ret-2)); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(239,68,68,.35); }
.rl-root .modal-icon svg { width: 18px; height: 18px; color: #fff; }
.rl-root .modal-title { font-size: 15px; font-weight: 900; }
.rl-root .modal-subtitle { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.rl-root .modal-close { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border: 1px solid var(--card-border); cursor: pointer; color: var(--text-muted); transition: all var(--dur-fast); border: none; }
.rl-root .modal-close:hover { background: rgba(239, 68, 68, 0.12); color: var(--ret); }
.rl-root .modal-close svg { width: 14px; height: 14px; }

.rl-root .modal-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.rl-root .modal-body::-webkit-scrollbar { width: 5px; }
.rl-root .modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }

.rl-root .detail-section { margin-bottom: 16px; }
.rl-root .detail-section:last-child { margin-bottom: 0; }
.rl-root .detail-title { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.rl-root .detail-title svg { width: 11px; height: 11px; }

.rl-root .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.rl-root .info-cell { background: var(--bg-input); border: 1px solid var(--card-border); border-radius: 10px; padding: 9px 12px; }
.rl-root .info-cell.full { grid-column: 1 / -1; }
.rl-root .info-cell-label { font-size: 10px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; letter-spacing: 0.04em; }
.rl-root .info-cell-val { font-size: 13px; font-weight: 800; color: var(--text); }
.rl-root .info-cell-val.ret { color: var(--ret); }

.rl-root .items-list { display: flex; flex-direction: column; gap: 8px; }
.rl-root .item-row { background: var(--bg-input); border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: 1fr 50px 80px; gap: 8px; align-items: center; }
.rl-root .item-name { font-size: 12px; font-weight: 700; }
.rl-root .item-qty { font-size: 12px; font-weight: 800; text-align: center; color: var(--text-sub); }
.rl-root .item-total { font-size: 12px; font-weight: 900; text-align: right; color: var(--ret); }

/* ═══════════════════════════════════════════════════════════════
   LOADING & EMPTY
═══════════════════════════════════════════════════════════════ */
.rl-root .loading { text-align: center; padding: 40px 20px; }
.rl-root .spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--ret); border-radius: 50%; animation: rl-spin 0.8s linear infinite; }
.rl-root .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 20px; text-align: center; }
.rl-root .empty-state svg { width: 48px; height: 48px; color: var(--text-muted); opacity: 0.3; margin-bottom: 12px; }
.rl-root .empty-title { font-size: 14px; font-weight: 800; color: var(--text-sub); margin-bottom: 5px; }
.rl-root .empty-sub { font-size: 11.5px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.rl-root .footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 10px; border-top: 1px solid var(--border); flex-shrink: 0; gap: 10px; flex-wrap: wrap; }
.rl-root .count-text { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.rl-root .count-text strong { color: var(--text-sub); }

/* ═══════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════ */
.rl-root .toast { position: fixed; bottom: 20px; right: 20px; background: rgba(10, 14, 30, 0.97); border: 1px solid var(--card-border); border-radius: 10px; padding: 12px 16px; color: var(--text); font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: rl-slideUp 0.3s ease both; z-index: 9999; }
@keyframes rl-slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.rl-root .toast.success { border-color: rgba(16, 185, 129, 0.5); }
.rl-root .toast.error { border-color: rgba(239, 68, 68, 0.5); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
    .rl-root .kpi-strip { grid-template-columns: repeat(3, 1fr); }
    .rl-root .kpi-card:nth-child(4), .rl-root .kpi-card:nth-child(5) { display: none; }
}

@media (max-width: 640px) {
    .rl-root .kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .rl-root .kpi-card:nth-child(3), .rl-root .kpi-card:nth-child(4), .rl-root .kpi-card:nth-child(5) { display: none; }
    .rl-root .header-date-badge { display: none; }
    .rl-root .returns-table { font-size: 11px; }
    .rl-root .returns-table td { padding: 6px 8px; }
}

/* ══ LIGHT MODE OVERRIDES ══ */
[data-theme="light"] .rl-root { background: transparent; }
[data-theme="light"] .rl-root .panel-header { background: rgba(255,252,252,0.97); border-bottom-color: rgba(var(--th-n-900-rgb),0.09); }
[data-theme="light"] .rl-root .panel-title { color: var(--th-n-900); }
[data-theme="light"] .rl-root .panel-subtitle { color: var(--th-n-500); }
[data-theme="light"] .rl-root .header-date-badge { background: rgba(var(--th-n-900-rgb),0.05); border-color: rgba(var(--th-n-900-rgb),0.09); color: var(--th-n-600); }
[data-theme="light"] .rl-root .header-refresh-btn { background: rgba(var(--th-n-900-rgb),0.04); border-color: rgba(var(--th-n-900-rgb),0.09); color: var(--th-n-500); }
[data-theme="light"] .rl-root .kpi-card { background: rgba(255,255,255,0.92); border-color: rgba(var(--th-n-900-rgb),0.09); box-shadow: 0 2px 12px rgba(30,60,120,0.07), 0 1px 0 rgba(255,255,255,0.9) inset; }
[data-theme="light"] .rl-root .kpi-label { color: var(--th-n-500); }
[data-theme="light"] .rl-root .kpi-value { color: var(--th-n-900); }
[data-theme="light"] .rl-root .kpi-sub { color: var(--th-n-400); }
[data-theme="light"] .rl-root .tabs-bar { background: rgba(var(--th-l-3-rgb),0.97); border-bottom-color: rgba(var(--th-n-900-rgb),0.09); }
[data-theme="light"] .rl-root .tab { color: var(--th-n-500); }
[data-theme="light"] .rl-root .tab:hover { color: var(--th-n-700); }
[data-theme="light"] .rl-root .tab.active { color: #dc2626; border-bottom-color: #dc2626; }
[data-theme="light"] .rl-root .table-wrapper::-webkit-scrollbar-thumb { background: rgba(var(--th-n-900-rgb),0.12); }
[data-theme="light"] .rl-root .returns-table thead th { background: rgba(var(--th-l-3-rgb),0.97); color: var(--th-n-500); backdrop-filter: blur(16px); }
[data-theme="light"] .rl-root .returns-table tbody tr td { background: rgba(255,255,255,0.88); border-color: rgba(var(--th-n-900-rgb),0.07); }
[data-theme="light"] .rl-root .returns-table tbody tr:hover td { background: rgba(220,38,38,0.04); }
[data-theme="light"] .rl-root .cell-id { color: #dc2626; }
[data-theme="light"] .rl-root .cell-amount { color: #dc2626; }
[data-theme="light"] .rl-root .cell-date { color: var(--th-n-600); }
[data-theme="light"] .rl-root .cell-time { color: var(--th-n-400); }
[data-theme="light"] .rl-root .cell-muted { color: var(--th-n-400); }
[data-theme="light"] .rl-root .cell-user { color: var(--th-n-600); }
[data-theme="light"] .rl-root .reason-chip { background: rgba(245,158,11,0.10); color: #b45309; }
[data-theme="light"] .rl-root .info-cell { background: rgba(var(--th-l-3-rgb),0.9); border-color: rgba(var(--th-n-900-rgb),0.09); }
[data-theme="light"] .rl-root .info-cell-label { color: var(--th-n-500); }
[data-theme="light"] .rl-root .info-cell-val { color: var(--th-n-900); }
[data-theme="light"] .rl-root .info-cell-val.ret { color: #dc2626; }
[data-theme="light"] .rl-root .item-row { background: rgba(var(--th-l-3-rgb),0.9); border-color: rgba(var(--th-n-900-rgb),0.09); }
[data-theme="light"] .rl-root .detail-title { color: var(--th-n-500); }
[data-theme="light"] .rl-root .modal { background: rgba(255,255,255,0.98); border-color: rgba(var(--th-n-900-rgb),0.09); box-shadow: 0 24px 64px rgba(30,60,120,0.18); }
[data-theme="light"] .rl-root .modal-header { border-bottom-color: rgba(var(--th-n-900-rgb),0.09); }
[data-theme="light"] .rl-root .modal-title { color: var(--th-n-900); }
[data-theme="light"] .rl-root .modal-close { background: rgba(var(--th-n-900-rgb),0.04); }
[data-theme="light"] .rl-root .modal-close:hover { background: rgba(220,38,38,0.09); color: #dc2626; }
[data-theme="light"] .rl-root .modal-body::-webkit-scrollbar-thumb { background: rgba(var(--th-n-900-rgb),0.12); }

/* ══════════════════════════════════════════════════════════
   V2 — إضافات خاصة بالتشغيل داخل MainLayout (ليست من Legacy)
══════════════════════════════════════════════════════════ */
/* Legacy صفحة مستقلة داخل iframe بـhtml,body{height:100%;overflow:hidden}؛ هنا داخل .content-area المشترك —
   نفس حل stocktake-legacy.css، مقيَّد بهذه الشاشة فقط عبر :has(). */
.content-area:has(.rl-root) { height: calc(100 * var(--vh)); overflow: hidden; padding: 0; display: flex; flex-direction: column; }
@media (max-width: 480px) { .content-area:has(.rl-root) { padding-top: 60px; } }
.rl-root { flex: 1; min-height: 0; height: auto; position: relative; direction: rtl; }

/* position:fixed بالـLegacy كان داخل الـiframe (يغطي اللوحة فقط) — absolute داخل .rl-root يعيد نفس السلوك. */
.rl-root .modal-overlay, .rl-root .toast { position: absolute; }

/* زر القائمة العام (.mobile-menu-btn، fixed أعلى اليمين) — مساحة محجوزة له بالهيدر، نفس stocktake-legacy.css. */
.rl-root .panel-header { padding-right: 80px; min-height: 70px; }

/* مرتجع واحد ممكن يجمع رد نقدي + خصم من المديونية (V2) — الشارتان جنب بعض. */
.rl-root .rl-badges { display: inline-flex; gap: 4px; }
