/* كشف الحساب + توحيد الألوان (أزرق فواتير · أخضر سندات · برتقالي مرتجعات · أحمر مدين) */
/* ألوان وكلاسات عامة بتستخدمها شاشات تانية كمان — ماتتشالش */
.chip { padding: 2px 10px; border-radius: 99px; border: 1px solid var(--stroke); background: var(--glass-2); font-size: 12px; }
label.f { display: flex; flex-direction: column; } label.f small { font-size: 10.5px; color: var(--text-mute); }
.seg button { padding: 5px 11px; font-weight: 700; font-size: 12.5px; }
.seg button.on { background: var(--accent); color: #062a24; }
.st-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }          /* (الاستوديو بيستخدمها) */
.st-top h1 { font-size: 17px; font-weight: 800; margin: 0; }
.dr { color: var(--bad); } .cr { color: var(--ok); } .rt { color: var(--warn); }
.t-sale, .t-raw_sale, .t-purchase { color: #3b82f6; } .t-receipt { color: var(--ok); } .t-payment { color: var(--warn); }
.t-sale_return, .t-raw_sale_return, .t-purchase_return { color: var(--warn); }

/* ---- (2026-11-26) الكشف المبسّط ---- */
.st-modal .modal { width: min(1100px, 97vw) !important; max-height: 96vh; background: color-mix(in srgb, var(--bg-2) 94%, transparent); }
html[data-theme="light"] .st-modal .modal { background: rgba(244,248,245,.97); }
.st-modal .modal > header { display: none; }
.st-modal .modal .body { padding: 10px 12px; gap: 8px; }
.sx { display: flex; flex-direction: column; gap: 8px; font-weight: 700; }

/* الاسم يمين — الرصيد شمال */
.sx-head { display: flex; align-items: center; gap: 10px; }
.sx-who { flex: 1; min-width: 0; }
.sx-who small { display: block; font-size: 12px; color: var(--text-mute); font-weight: 700; }
.sx-who h1 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-bal { text-align: center; padding: 6px 16px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--glass-2); }
.sx-bal small { display: block; font-size: 11px; color: var(--text-mute); }
.sx-bal b { font-size: 22px; font-weight: 900; white-space: nowrap; }
.sx-bal.dr { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.sx-bal.cr { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.sx-x { align-self: flex-start; }

/* سطر الفترة والأوامر */
.sx-bar { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.sx-bar .f { min-height: 32px; padding: 3px 8px; font-weight: 700; }
.sx-dt { display: flex; flex-direction: column; flex: 0 0 132px; } .sx-dt small { font-size: 10.5px; color: var(--text-mute); } .sx-dt input { width: 100%; }
.sx-q { flex: 0 1 130px; min-width: 96px; }
.sx-sp { flex: 1; }
.sx-sep { width: 1px; align-self: stretch; background: var(--stroke); margin: 2px 2px; }

/* الجدول: ٥ أعمدة */
.sx-tbl { overflow: auto; max-height: 62vh; border-radius: 12px; border: 1px solid var(--stroke); background: #fbfdfc; }
html[data-theme="dark"] .sx-tbl { background: #1a2540; }
.sx table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sx th { position: sticky; top: 0; z-index: 1; background: var(--glass-hi); padding: 7px 10px; font-size: 12.5px; color: var(--text-dim); font-weight: 800; }
.sx td { padding: 6px 10px; border-bottom: 1px solid var(--stroke); text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sx .n { text-align: start; white-space: normal; }
.sx td.n b { font-weight: 800; }
.sx td.n small { display: block; font-size: 11.5px; color: var(--text-mute); font-weight: 600; margin-top: 1px; }
.sx td.d { color: var(--text-dim); width: 96px; }
.sx td.b { font-weight: 800; }
.sx td.b small { font-size: .86em; font-weight: 700; }
.sx .dm { display: none; }
.sx tr.rw { outline: none; }
.sx tr.rw.more { cursor: pointer; }
.sx tr.rw:hover td, .sx tr.rw:focus td { background: var(--glass-2); }
.sx tr.rw:focus td:first-child { box-shadow: inset -3px 0 0 var(--accent); }
.sx .cv { font-style: normal; font-size: 11px; color: var(--text-mute); margin-inline-start: 6px; display: inline-block; transition: transform .15s; }
.sx tr.rw.on .cv { transform: rotate(180deg); }
.sx tr.rw.on td { background: color-mix(in srgb, var(--accent) 10%, transparent); border-bottom-color: transparent; }
.sx tr.op td, .sx tr.cl td { background: color-mix(in srgb, var(--accent) 13%, transparent); font-weight: 800; }
/* صف الإجمالي ثابت تحت — بلون مصمت عشان السطور ماتبانش من تحته */
.sx tr.cl td { position: sticky; bottom: 0; background: #e3efe8; border-top: 1px solid var(--stroke-hi, var(--stroke)); }
.sx th { background: #eef4f0; }
html[data-theme="dark"] .sx tr.cl td { background: #1f3a33; }
html[data-theme="dark"] .sx th { background: #243150; }

/* التفاصيل تحت السطر */
.sx tr.dt > td { padding: 0 10px 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); text-align: start; white-space: normal; }
.sx-det { border: 1px solid var(--stroke); border-radius: 10px; background: var(--glass); padding: 6px 10px; max-width: 680px; }
.sx-it { font-size: 13px !important; }
.sx-it th { position: static; background: none; padding: 3px 8px; font-size: 11.5px; color: var(--text-mute); border-bottom: 1px solid var(--stroke); }
.sx-it td { padding: 3px 8px; border-bottom: 1px dotted var(--stroke); }
.sx-it tr:last-child td { border-bottom: 0; }
.sx .sx-it td.n small { display: inline; font-size: 11px; margin: 0; }
.sx-inf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 6px; font-size: 12.5px; color: var(--text-dim); }
.sx-inf span { flex: 1; min-width: 160px; }

@media (max-width: 760px) {
  .sx-head { flex-wrap: wrap; } .sx-who { flex: 1 1 60%; } .sx-who h1 { font-size: 18px; white-space: normal; }
  .sx-bal { order: 3; flex: 1 1 100%; display: flex; align-items: baseline; justify-content: space-between; padding: 6px 12px; }
  .sx-bal b { font-size: 19px; }
  .sx-bar { gap: 5px; } .sx-bar .seg { flex: 1 1 100%; }
  .sx-dt { flex: 1 1 0; min-width: 0; } .sx-dt input { min-width: 0; }
  .sx-q { flex: 1 1 100%; } .sx-sp, .sx-sep { display: none; }
  .sx-bar .btn { flex: 1 1 auto; padding-inline: 8px; font-size: 12.5px; }
  .sx table { font-size: 12.5px; } .sx td, .sx th { padding: 5px 5px; }
  .sx td.b small { display: block; font-size: 10.5px; }
  .sx .d { display: none; } .sx .dm { display: block; font-size: 11px; color: var(--text-mute); font-weight: 600; }
  .sx-tbl { max-height: 58vh; } .sx tr.dt > td { padding: 0 4px 8px; } .sx-det { padding: 4px 6px; }
}
@media print {
  .st-modal .modal { max-height: none; }
  .sx-bar, .sx-x, .sx-inf button, .sx .cv { display: none !important; }
  .sx-tbl { max-height: none; overflow: visible; } .sx tr.cl td { position: static; }
}
