/* ═══════════════════════════════════════════════════════════════════
   DELMON OPERATION SYSTEM — Responsive Design
   Additive layer: never overwrites existing rules, only supplements.
   Breakpoints:
     XL  ≥ 1400px  — large desktop / wide monitor
     LG  1100–1399px — laptop / regular desktop
     MD   769–1099px — tablet landscape / small laptop
     SM   481–768px  — tablet portrait / large phone
     XS   ≤ 480px   — phone
═══════════════════════════════════════════════════════════════════ */

/* ─── BASE: fluid type scale using clamp() ─── */
:root {
  --title-size:    clamp(18px, 2.2vw, 28px);
  --subtitle-size: clamp(12px, 1.2vw, 15px);
  --label-size:    clamp(11px, 1vw, 13px);
  --data-size:     clamp(13px, 1.3vw, 16px);
  --num-lg-size:   clamp(22px, 3vw, 36px);
  --num-md-size:   clamp(18px, 2.4vw, 28px);
  --num-sm-size:   clamp(14px, 1.6vw, 20px);
}

/* ─── Global: ensure ALL tables scroll horizontally ─── */
.table-wrap,
.table-scroll,
[class*="-table-wrap"],
[class*="-scroll"] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Global: prevent body overflow on all sizes ─── */
html, body { max-width: 100%; }
img, video, svg { max-width: 100%; }

/* ─── Page titles: fluid sizing ─── */
.page-title   { font-size: var(--title-size); }
.page-sub     { font-size: var(--label-size); }
.card-title   { font-size: var(--label-size); }
.section-title { font-size: clamp(13px, 1.4vw, 16px); }

/* ─── KPI / stat numbers: fluid ─── */
.stat-value,
.kpi-value,
[class*="-kpi-value"],
[class*="-stat-value"]   { font-size: var(--num-lg-size); }

.stat-label,
.kpi-label,
[class*="-kpi-label"],
[class*="-stat-label"]   { font-size: var(--label-size); }

/* ─── Buttons: ensure minimum touch target 44px ─── */
.btn {
  min-height: 36px;
  font-size: clamp(11px, 1.1vw, 13px);
}

/* ─── Inputs: fluid ─── */
input, select, textarea {
  font-size: clamp(13px, 1.2vw, 14px);
}

/* ════════════════════════════════════════
   XL — ≥ 1400px: wide desktop
════════════════════════════════════════ */
@media (min-width: 1400px) {
  .main {
    padding: 40px 56px 70px;
  }
  .sidebar {
    width: 264px;
  }
  .main {
    width: calc(100% - 264px);
  }
  .stats       { grid-template-columns: repeat(4, 1fr); }
  .kpi-grid    { grid-template-columns: repeat(4, 1fr); }
  .fg3         { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════
   LG — 1100–1399px: laptop / desktop
════════════════════════════════════════ */
@media (max-width: 1399px) and (min-width: 1100px) {
  .main {
    padding: 32px 36px 56px;
  }
  .sidebar { width: 230px; }
  .main    { width: calc(100% - 230px); }
  .stats       { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid    { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════
   MD — 769–1099px: tablet landscape / small laptop
════════════════════════════════════════ */
@media (max-width: 1099px) and (min-width: 769px) {
  .main {
    padding: 24px 22px 48px;
  }
  .sidebar { width: 210px; }
  .main    { width: calc(100% - 210px); }

  /* Stack header row on smaller laptops */
  .page-header-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Card adjustments */
  .card { padding: 18px 20px; }

  /* Grids: 2 columns max */
  .fg3         { grid-template-columns: repeat(2, 1fr) !important; }
  .stats       { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid    { grid-template-columns: repeat(2, 1fr); }
  .sm-grid     { grid-template-columns: repeat(3, 1fr); }

  /* Tables */
  th, td { font-size: 11.5px !important; padding: 9px 10px !important; }
  th     { font-size: 10px !important; }

  /* Buttons in rows wrap */
  .btn-row        { flex-wrap: wrap; }
  .btn-row .btn   { flex: 1 1 120px; }

  /* Inputs */
  input, select, textarea { font-size: 13px; }
}

/* ════════════════════════════════════════
   SM — 481–768px: tablet portrait / large phone
════════════════════════════════════════ */
@media (max-width: 768px) and (min-width: 481px) {
  .main {
    padding: 70px 16px 32px;
    width: 100%;
    overflow-x: hidden;
  }

  /* Page header */
  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }
  .page-header-row > *:last-child {
    width: 100%;
  }
  .page-header-row .btn-row,
  .page-header-row .actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .page-header-row .btn { flex: 1 1 auto; min-width: 100px; }

  .page-header { margin-bottom: 18px; }
  .card        { padding: 16px 18px; margin-bottom: 14px; }
  .card-title  { margin-bottom: 14px; }

  /* All grids → single column */
  .fg, .fg3, .stats, .kpi-grid, .summary-panel { grid-template-columns: 1fr !important; }
  .sm-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Tables */
  table { font-size: 12px !important; }
  th    { font-size: 10px !important; padding: 7px 8px !important; }
  td    { font-size: 12px !important; padding: 9px 8px !important; }

  /* Inputs: prevent zoom on iOS (must be ≥16px) */
  input, select, textarea {
    font-size: 16px !important;
    min-height: 44px;
  }

  .btn { min-height: 44px; font-size: 13px; }
  .btn-sm { min-height: 38px; font-size: 12px; }

  /* Buttons in btn-row become full-width */
  .btn-row { flex-direction: column; gap: 8px; }
  .btn-row .btn { width: 100%; }
}

/* ════════════════════════════════════════
   XS — ≤ 480px: phone
════════════════════════════════════════ */
@media (max-width: 480px) {
  .main {
    padding: 62px 12px 28px;
    width: 100%;
    overflow-x: hidden;
  }

  .page-title  { font-size: clamp(17px, 5vw, 22px); }
  .page-sub    { font-size: 11px; }
  .page-header { margin-bottom: 14px; }
  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }
  .page-header-row > * { width: 100%; }

  .card        { padding: 14px 14px; margin-bottom: 12px; border-radius: 12px; }
  .card-title  { font-size: 12px; margin-bottom: 12px; }

  /* All grids → single column */
  .fg, .fg3, .stats, .kpi-grid,
  .summary-panel, .sm-grid { grid-template-columns: 1fr !important; }

  /* Stat cards: horizontal layout on small phone */
  .stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
  }
  .stat-value    { font-size: 26px; }
  .stat-label    { font-size: 11px; }
  .stat-icon     { font-size: 22px; flex-shrink: 0; }

  /* Tables */
  table { font-size: 11px !important; }
  th    { font-size: 9.5px !important; padding: 6px 7px !important; }
  td    { font-size: 11px !important;  padding: 8px 7px !important; }

  /* Inputs */
  input, select, textarea {
    font-size: 16px !important;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .btn    { min-height: 46px; font-size: 14px; padding: 10px 16px; }
  .btn-sm { min-height: 40px; font-size: 12px; }

  .btn-row {
    flex-direction: column;
    gap: 8px;
  }
  .btn-row .btn { width: 100%; justify-content: center; }

  /* Section titles */
  .section-title { font-size: 13px; }

  /* Modal/dialog improvements */
  [class*="-modal"],
  [class*="-dialog"] {
    margin: 8px;
    max-width: calc(100vw - 16px);
    border-radius: 16px;
  }

  /* Badge / tag sizes */
  .badge, [class*="-badge"] { font-size: 10px; padding: 3px 7px; }
}

/* ═══════════════════════════════════════════════════════
   PAGE-SPECIFIC RESPONSIVE IMPROVEMENTS
═══════════════════════════════════════════════════════ */

/* ── Fresh PICKLIST ── */
@media (max-width: 1099px) {
  .freezer-pick-route-tabs {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
  }
}
@media (max-width: 768px) {
  .freezer-pick-route-tabs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .freezer-pick-route-tab span { font-size: 17px !important; }
  .freezer-pick-route-tab strong { font-size: 11px !important; }
  .freezer-pick-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .freezer-pick-actions .btn { flex: 1 1 auto; min-width: 100px; }
}
@media (max-width: 480px) {
  .freezer-pick-route-tabs {
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
  }
}

/* ── Sales distribution table: always horizontally scrollable ── */
.sales-dist-table-wrap,
.sd-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  position: relative;
}
@media (max-width: 1099px) {
  .sales-dist-table { min-width: 1200px !important; }
  .sales-dist-toolbar { flex-wrap: wrap; gap: 8px; }
  .sales-dist-meta    { flex-wrap: wrap; gap: 8px; }
}

/* ── DL1 / RTN1 entry pages ── */
@media (max-width: 768px) {
  [class*="-entry-form"] {
    grid-template-columns: 1fr !important;
  }
  [class*="-entry-header"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  [class*="-entry-actions"] { width: 100%; }
  [class*="-entry-actions"] .btn { flex: 1; }
}

/* ── Online orders / internal sales paste pages ── */
@media (max-width: 768px) {
  .online-internal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .online-internal-placeholder { padding: 24px 16px; min-height: 220px; }
  .online-lines-tabs {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 480px) {
  .online-lines-tabs {
    grid-template-columns: 1fr !important;
  }
}

/* ── Inventory / جرد ── */
@media (max-width: 768px) {
  [class*="inv-"] {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ── KPI dashboard ── */
@media (max-width: 1099px) {
  .kpi-dashboard-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
  .kpi-dashboard-grid { grid-template-columns: 1fr !important; }
}

/* ── Reception / قائمة المخازن ── */
@media (max-width: 768px) {
  .reception-tabs,
  [class*="-tabs"] {
    flex-wrap: wrap;
    gap: 6px;
  }
  .reception-tabs .tab,
  [class*="-tabs"] .tab {
    flex: 1 1 auto;
    min-width: 80px;
    text-align: center;
  }
}

/* ── Compare / مقارنة ── */
@media (max-width: 1099px) {
  [class*="compare-"] { flex-wrap: wrap; }
  [class*="compare-grid"] { grid-template-columns: 1fr !important; }
}

/* ── Production pages ── */
@media (max-width: 768px) {
  [class*="prod-"] .btn-row { flex-direction: column; }
  [class*="prod-"] .btn-row .btn { width: 100%; }
  [class*="farm-grid"] { grid-template-columns: 1fr !important; }
}

/* ── Route orders / Sales route ── */
@media (max-width: 768px) {
  .route-orders-head { flex-direction: column; gap: 10px; }
  .route-orders-head-actions { width: 100%; }
  .route-orders-head-actions .btn { flex: 1; }
  .route-orders-kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .route-orders-cards { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .route-orders-kpis { grid-template-columns: 1fr 1fr !important; }
}

/* ── Frozen warehouse / مخازن المجمد ── */
@media (max-width: 768px) {
  .fwh-filters { flex-direction: column; gap: 8px; }
  .fwh-filters select,
  .fwh-filters input { width: 100%; }
  .fz-analytics-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 480px) {
  .fz-analytics-grid { grid-template-columns: 1fr !important; }
  .fz-panel-grid     { grid-template-columns: 1fr !important; }
}

/* ── Frozen orders ── */
@media (max-width: 768px) {
  .fso-stats       { grid-template-columns: repeat(2, 1fr) !important; }
  .fso-filter-grid { grid-template-columns: 1fr !important; }
  .fso-tabs        { flex-wrap: wrap; gap: 6px; }
  .frozen-sales-orders-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .fso-header-actions { width: 100%; }
  .fso-header-actions .btn { flex: 1; }
}
@media (max-width: 480px) {
  .fso-stats { grid-template-columns: 1fr 1fr !important; }
}

/* ── Dynamic transfer ── */
@media (max-width: 768px) {
  .dynamic-transfer-grid { grid-template-columns: 1fr !important; }
  .dynamic-transfer-copy-card { position: static !important; }
  .dynamic-transfer-meta { grid-template-columns: 1fr 1fr !important; }
  .dynamic-transfer-actions .btn { flex: 1; }
}

/* ── Sales permanent page ── */
@media (max-width: 768px) {
  [class*="permanent-"] .table-wrap { overflow-x: auto; }
  [class*="permanent-header"]  { flex-direction: column; gap: 10px; }
  [class*="permanent-actions"] { width: 100%; }
  [class*="permanent-actions"] .btn { flex: 1; }
}

/* ═══════════════════════════════════════════════════════
   TYPOGRAPHY IMPROVEMENTS: clearer numbers & data
═══════════════════════════════════════════════════════ */

/* Large display numbers (KPI, totals) */
.stat-value,
.kpi-value,
.freezer-pick-route-tab span,
[class*="-total-value"],
[class*="-count-value"] {
  font-family: var(--f-serif), var(--f-mono), monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Table numbers */
td[data-type="number"],
td.qty,
td.amount,
td.total,
[class*="-qty"],
[class*="-amount"],
[class*="-total"] {
  font-family: var(--f-mono), monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Ensure long Arabic text doesn't cause layout breaks */
.page-sub,
.nav-label,
.card-title,
td {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ═══════════════════════════════════════════════════════
   SCROLLBAR STYLING (improves UX when content overflows)
═══════════════════════════════════════════════════════ */
.table-wrap::-webkit-scrollbar,
[class*="-scroll"]::-webkit-scrollbar,
.main::-webkit-scrollbar {
  height: 5px;
  width: 5px;
}
.table-wrap::-webkit-scrollbar-track,
[class*="-scroll"]::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb,
[class*="-scroll"]::-webkit-scrollbar-thumb {
  background: var(--hair-3);
  border-radius: 99px;
}
.table-wrap::-webkit-scrollbar-thumb:hover,
[class*="-scroll"]::-webkit-scrollbar-thumb:hover {
  background: var(--ink-4);
}

/* ═══════════════════════════════════════════════════════
   PRINT: ensure crisp output
═══════════════════════════════════════════════════════ */
@media print {
  .main { padding: 0 !important; width: 100% !important; }
  .btn, .btn-row, .mobile-toggle { display: none !important; }
  .table-wrap { overflow: visible !important; }
  table { font-size: 10px !important; }
  .page-title { font-size: 16px !important; }
}

/* ═══════════ V9.4.72 — Zoom/Resize Readability Fix ═══════════
   1) منع تكسّر الكلمات حرفاً-حرفاً (عمودياً) داخل خلايا الجداول عند تصغير
      الشاشة أو الـ zoom: الخلايا لا تلتف؛ الجدول يتمرّر أفقياً بدلاً من الانضغاط.
   2) رفع الحدود الدنيا لأحجام الخط في كل الأقسام لوضوح أكبر مع أي Zoom. */
:root{
  --title-size:    clamp(20px, 2.2vw, 30px);
  --subtitle-size: clamp(13px, 1.2vw, 16px);
  --label-size:    clamp(12px, 1.05vw, 14px);
  --data-size:     clamp(14px, 1.35vw, 17px);
  --num-lg-size:   clamp(24px, 3vw, 38px);
  --num-md-size:   clamp(19px, 2.4vw, 29px);
  --num-sm-size:   clamp(15px, 1.6vw, 21px);
}
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body{ font-size: var(--data-size); }

/* الجداول في كل الصفحات: لا التفاف حرفي داخل الخلايا — تمرير أفقي مريح */
.table-wrap,
[class*="-table-wrap"],
.table-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.table-wrap table,
[class*="-table-wrap"] table,
.table-scroll table{
  width:max-content;
  min-width:100%;
}
th,td{
  white-space:nowrap;
  word-break:keep-all;
  overflow-wrap:normal;
}
td{ font-size:var(--data-size); }
th{ font-size:var(--label-size); }

/* جدول DL1/RTN1 المضغوط يحتفظ بخطه المضبوط (كثافة أعمدة عالية) */
.sales-dist-table th,.sales-dist-table td{ font-size:11px; }

/* ═══════════ V9.4.73 — Table Fit-Zoom + Global Bold Clarity ═══════════
   1) شريط تحكم عرض الجدول (ملاءمة/تكبير/تصغير) لجداول DL1/RTN1/التوزيع النهائي.
   2) رفع خط جداول sales-dist من 11px إلى 13.5px عريض — مع وضع «ملاءمة العرض»
      يبقى الخط الفعلي أوضح بكثير من تصغير المتصفح إلى 50%.
   3) وضوح عام في جميع الصفحات: أوزان خط أثقل وحدود دنيا أعلى. */

/* ── شريط التحكم ── */
.dz-zoom-bar{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin:10px 0 8px; padding:8px 12px;
  background:#fff; border:1px solid var(--hair-2,#e5e7eb); border-radius:10px;
}
.dz-zoom-label{ font-size:13px; font-weight:800; color:var(--ink-2,#374151); }
.dz-btn{
  height:32px; padding:0 14px; border-radius:8px;
  border:1px solid var(--hair-3,#d1d5db); background:#f9fafb;
  font-size:13px; font-weight:800; color:#111; cursor:pointer;
  font-family:inherit;
}
.dz-btn:hover{ background:#eef2f7; }
.dz-btn.dz-active{ background:var(--brand,#d7282f); color:#fff; border-color:var(--brand,#d7282f); }
.dz-btn-sq{ width:32px; padding:0; font-size:17px; line-height:1; }
.dz-pct{
  min-width:52px; text-align:center; font-family:var(--f-mono),monospace;
  font-size:13.5px; font-weight:900; color:#111;
  font-variant-numeric:tabular-nums;
}
.dz-hint{ font-size:11px; color:var(--ink-3,#6b7280); margin-inline-start:auto; font-weight:600; }
@media print{ .dz-zoom-bar{ display:none!important; } }

/* ── جداول DL1/RTN1/التوزيع النهائي: خط أكبر وأثقل (كان 11px) ── */
.sales-dist-table th,
.sales-dist-table td{ font-size:13.5px; font-weight:700; padding:5px 7px!important; }
.sales-dist-table .sd-title-row th{ font-size:15.5px; font-weight:900; }
.sales-dist-table .sd-cat-row td{ font-size:14px; font-weight:900; }
.sales-dist-table .sd-product{ font-weight:900; }
.sales-dist-table .sd-code{ font-size:10.5px; font-weight:700; }
.sales-dist-input{
  font-size:13.5px!important; font-weight:800!important;
  height:28px!important; min-height:28px!important;
}
.sales-dist-num{ font-size:13.5px; }
.sales-dist-seller-select{ font-size:12.5px!important; font-weight:800!important; }

/* ── وضوح عام — جميع الصفحات ── */
:root{
  --data-size:  clamp(15px, 1.4vw, 17px);
  --label-size: clamp(13px, 1.1vw, 15px);
  --title-size: clamp(21px, 2.3vw, 31px);
}
body{ text-rendering:optimizeLegibility; }
td{ font-weight:600; }
th{ font-weight:800; }
.page-title{ font-weight:900; }
.page-sub{ font-weight:600; }
.nav-label{ font-weight:700; }
.btn{ font-weight:800; }
label, .field-label, [class*="-label"]{ font-weight:700; }
.stat-value, .kpi-value{ font-weight:900; }

/* الاستثناء المقصود سابقاً (11px لجدول sales-dist) أُلغي هنا عمداً:
   وضع «ملاءمة العرض» يعوّض العرض، والخط الأكبر يعوّض الوضوح. */

/* ═══════════ V9.4.74 — إصلاح الكتابة المخفية في صفوف الفئات ═══════════
   السبب الجذري: قاعدة «الخلايا غير الملوّنة بيضاء» في patches.css
   (id + سلسلة :not — محدّدية 1,7,1) تتغلب على خلفية صف الفئة،
   بينما لون النص يبقى أبيض من قاعدة hotfix → نص أبيض على أبيض.
   الحل: نفس سلسلة :not + كلاس الصف (محدّدية 1,8,2) وفي ملف يُحمَّل
   أخيراً، فتفوز الخلفية الصحيحة نهائياً. */
#page-sales-dl1 .sales-dist-table tr.sd-cat-row > td:not(.sd-qty):not(.sd-fresh):not(.sd-online):not(.sd-internal):not(.sd-distributed):not(.sd-balance),
#page-sales-dl1 .sales-dist-table tr.sd-cat-row > td{
  background:#ff0000!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}
#page-sales-rtn1 .sales-dist-table tr.sd-cat-row > td:not(.sd-qty):not(.sd-fresh):not(.sd-online):not(.sd-internal):not(.sd-distributed):not(.sd-balance),
#page-sales-rtn1 .sales-dist-table tr.sd-cat-row > td{
  background:#fff200!important;
  color:#111111!important;
  -webkit-text-fill-color:#111111!important;
}
#page-sales-final-distribution .sales-dist-table tr.sd-cat-row > td:not(.sd-qty):not(.sd-fresh):not(.sd-online):not(.sd-internal):not(.sd-distributed):not(.sd-balance),
#page-sales-final-distribution .sales-dist-table tr.sd-cat-row > td{
  background:#4285f4!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}

/* ═══════════ V9.4.75 — Global Font Enlargement (round 2) ═══════════
   طلب معاد: خطوط أكبر وأوضح في جميع الصفحات. رفع إضافي فوق V9.4.73. */
:root{
  --data-size:     clamp(16px, 1.5vw, 18px);
  --label-size:    clamp(14px, 1.2vw, 16px);
  --subtitle-size: clamp(14px, 1.3vw, 17px);
  --title-size:    clamp(22px, 2.4vw, 32px);
  --num-sm-size:   clamp(16px, 1.7vw, 22px);
}
td{ font-size:var(--data-size); font-weight:650; }
th{ font-size:var(--label-size); font-weight:800; }
.btn{ font-size:14px; }
.nav-label{ font-size:14.5px; font-weight:800; }
input, select, textarea{ font-size:15px!important; font-weight:600; }
.card-title{ font-weight:900; }
.sales-dist-note, .page-sub{ font-size:13.5px; }

/* جداول DL1/RTN1/التوزيع النهائي: رفع إضافي 13.5 → 14.5px */
.sales-dist-table th,
.sales-dist-table td{ font-size:14.5px; }
.sales-dist-table .sd-title-row th{ font-size:17px; }
.sales-dist-table .sd-cat-row td{ font-size:15px; }
.sales-dist-input{ font-size:14.5px!important; }
.sales-dist-num{ font-size:14.5px; }
.sd-code{ font-size:11px; }

/* ═══════════ V9.4.76 — قائمة الإكمال التلقائي لأسماء العملاء ═══════════ */
.cust-ac-anchor{ position:relative; }
.cust-ac-list{
  position:absolute; top:100%; right:0; left:0; z-index:3000;
  margin-top:4px; background:#fff;
  border:1px solid var(--hair-3,#d1d5db); border-radius:10px;
  box-shadow:0 10px 26px rgba(0,0,0,.14);
  max-height:280px; overflow-y:auto;
}
.cust-ac-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 12px; cursor:pointer;
  border-bottom:1px solid var(--hair-1,#f1f5f9);
}
.cust-ac-item:last-child{ border-bottom:none; }
.cust-ac-item:hover, .cust-ac-item.active{ background:#fdf0f0; }
.cust-ac-name{ font-size:14.5px; font-weight:700; color:#111; }
.cust-ac-name b{ color:var(--brand,#d7282f); font-weight:900; }
.cust-ac-meta{ font-size:11.5px; font-weight:700; color:var(--ink-3,#6b7280); white-space:nowrap; }

/* ═══════════ V9.4.84 — Stores Dashboard Live Widgets (aurora dark) ═══════════ */
.sdl-empty{ color:rgba(255,255,255,.45); text-align:center; padding:34px 10px; font-size:13.5px; font-weight:700; }

/* منحنى الأوزان + العقرب */
.sdl-curve-row{ display:flex; align-items:stretch; gap:14px; direction:ltr; }
.sdl-gauge{ flex:0 0 168px; display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07); border-radius:14px; padding:10px 6px; }
.sdl-gauge-svg{ width:150px; height:auto; }
.sdl-gauge-minmax{ fill:rgba(255,255,255,.5); font-size:11px; font-weight:700; font-family:monospace; }
.sdl-gauge-value{ color:#fff; font-size:24px; font-weight:900; font-family:monospace; margin-top:-6px; }
.sdl-gauge-value small{ font-size:11px; color:rgba(255,255,255,.55); margin-inline-start:4px; }
.sdl-gauge-label{ color:rgba(255,255,255,.55); font-size:11px; font-weight:700; margin-top:2px; }
.sdl-curve-box{ flex:1; min-width:0; }
.sdl-curve-svg{ width:100%; height:200px; }
.sdl-curve-pct{ fill:#fca5a5; font-size:15px; font-weight:800; font-family:monospace; }
.sdl-curve-pct.hot{ fill:#fff; font-size:17px; }
.sdl-curve-dot{ fill:#ef4444; stroke:#fff; stroke-width:1.5; }
.sdl-curve-dot.dim{ fill:rgba(255,255,255,.2); stroke:none; }
.sdl-curve-axis{ fill:rgba(255,255,255,.55); font-size:13px; font-weight:800; font-family:monospace; }

/* دونات الأنواع */
.sdl-donut-wrap{ display:flex; align-items:center; gap:16px; padding:6px 2px; }
.sdl-donut{ width:150px; height:150px; border-radius:50%; position:relative; flex:0 0 150px;
  box-shadow:0 0 0 1px rgba(255,255,255,.08), 0 8px 26px rgba(0,0,0,.4); }
.sdl-donut-hole{ position:absolute; inset:26px; border-radius:50%; background:#1c1112;
  display:flex; flex-direction:column; align-items:center; justify-content:center; }
.sdl-donut-hole b{ color:#fff; font-size:19px; font-weight:900; font-family:monospace; }
.sdl-donut-hole small{ color:rgba(255,255,255,.55); font-size:10.5px; font-weight:700; }
.sdl-legend{ flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; max-height:190px; overflow-y:auto; }
.sdl-legend-row{ display:flex; align-items:center; gap:8px; font-size:12.5px; }
.sdl-legend-dot{ width:9px; height:9px; border-radius:3px; flex:0 0 9px; }
.sdl-legend-name{ color:rgba(255,255,255,.85); font-weight:800; flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sdl-legend-kg{ color:rgba(255,255,255,.55); font-family:monospace; font-weight:700; }
.sdl-legend-pct{ color:#fca5a5; font-family:monospace; font-weight:900; min-width:46px; text-align:left; }

/* جدول جميع المنتجات */
.sdl-table-wrap{ max-height:340px; overflow-y:auto; border-radius:10px; }
.sdl-table{ width:100%; border-collapse:collapse; }
.sdl-table th{ position:sticky; top:0; background:#241416; color:rgba(255,255,255,.6);
  font-size:11.5px; font-weight:800; padding:8px 10px; text-align:right; z-index:1; }
.sdl-table td{ padding:7px 10px; border-top:1px solid rgba(255,255,255,.05);
  color:rgba(255,255,255,.9); font-size:13px; font-weight:700; }
.sdl-rank{ width:34px; text-align:center; color:rgba(255,255,255,.45); font-family:monospace; font-weight:900; }
.sdl-rank.top{ color:#f59e0b; }
.sdl-pname small{ display:block; color:rgba(255,255,255,.4); font-size:10.5px; font-weight:700; font-family:monospace; }
.sdl-num{ font-family:monospace; font-weight:800; white-space:nowrap; }
.sdl-share{ min-width:150px; }
.sdl-share-track{ height:6px; background:rgba(255,255,255,.08); border-radius:4px; overflow:hidden; display:inline-block; width:calc(100% - 56px); vertical-align:middle; }
.sdl-share-track i{ display:block; height:100%; background:linear-gradient(90deg,#ef4444,#f59e0b); border-radius:4px; }
.sdl-share b{ color:#fca5a5; font-family:monospace; font-size:12px; margin-inline-start:8px; }

@media (max-width: 900px){
  .sdl-curve-row{ flex-direction:column; }
  .sdl-donut-wrap{ flex-direction:column; }
}
