/* ==========================================================
   التقارير والسندات على الجوال: تصميم موحّد مع التقرير العام
   أحجام خطوط وشارات أصغر، وبطاقات لكل الجداول العريضة
   ========================================================== */

/* الشارات (مسدد / متأخر / معفى / قبل السكن / خرج) أصغر وبخط واضح */
#reportRoot .arr-st,#reportRoot .rv-badges .arr-st{font-size:10px!important;font-weight:700;line-height:1.35;padding:2px 7px!important;border-radius:999px;white-space:nowrap;display:inline-block;}
#residentReceiptsModal .receipt-status-active,#residentReceiptsModal .receipt-status-voided,#receiptsLedgerModal .receipt-status-active,#receiptsLedgerModal .receipt-status-voided{font-size:10px!important;padding:2px 8px!important;line-height:1.4;}

@media (max-width:760px){
  /* عناوين وبطاقات التقرير أصغر */
  #reportRoot .report-title{font-size:17px!important;line-height:1.4;}
  #reportRoot .report-sub{font-size:12px!important;}
  #reportRoot .resident-report-name{font-size:15px!important;}
  #reportRoot .rpt-sec h3,#reportRoot .rr-sec h3,#reportRoot .report-year h3{font-size:14px!important;margin:12px 0 8px!important;}
  #reportRoot .report-card{padding:8px 10px!important;}
  #reportRoot .report-card b{font-size:16px!important;}
  #reportRoot .report-card span{font-size:11px!important;}
  #reportRoot .report-cards{gap:8px!important;}

  /* الجداول العريضة تُخفى على الجوال وتظهر البطاقات بدلًا منها */
  #reportRoot:not(.rv-full) .rpt-table{display:none!important;}

  /* بطاقات الصفوف: شبكة من حقلين لكل قيمة */
  #reportRoot .rv-card{padding:9px 10px!important;border-radius:12px!important;}
  #reportRoot .rv-head{margin-bottom:7px!important;}
  #reportRoot .rv-tt{display:flex;flex-direction:column;gap:2px;min-width:0;}
  #reportRoot .rv-name{font-size:13.5px!important;}
  #reportRoot .rv-sub{font-size:11px;font-weight:700;color:#6b6456;}
  #reportRoot .rv-kvs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;}
  #reportRoot .rv-kv{display:flex;flex-direction:column;gap:1px;min-width:0;background:#faf8f2;border:1px solid #ece6d6;border-radius:10px;padding:5px 8px;}
  #reportRoot .rv-kv span{font-size:10px;font-weight:700;color:#6b6456;line-height:1.3;}
  #reportRoot .rv-kv b{font-size:12.5px;font-weight:800;color:#10201b;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;}
  #reportRoot .rv-card.rv-total .rv-kv{background:#fffaf0;border-color:#e6cf9c;}
  #reportRoot .rv-paid{font-size:10.5px!important;padding:2px 7px!important;}
  #reportRoot .rv-sum{font-size:12px!important;padding:2px 8px!important;}
  #reportRoot .rv-m span{font-size:9px!important;}
  #reportRoot .rv-m b{font-size:11px!important;}

  /* وضع الجداول الكاملة (عرض كما في PDF) */
  #reportRoot.rv-full .rpt-table{font-size:10.5px;min-width:640px;border-collapse:collapse;}
  #reportRoot.rv-full .rpt-table th,#reportRoot.rv-full .rpt-table td{padding:3px 4px!important;white-space:nowrap;}
  #reportRoot.rv-full .rpt-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}

  /* سندات القبض وسجل السندات: بطاقات مضغوطة */
  .resident-receipt-item{font-size:12px!important;padding:10px!important;}
  .resident-receipt-item-head{gap:6px!important;}
  .resident-receipt-item-head b{font-size:13px!important;}
  .resident-receipt-item-head span{font-size:11px!important;}
}

/* سجل السندات على الجوال: جدول يمرّر أفقيًا داخل حاويته بدل القص */
@media (max-width:760px){
  #receiptsLedgerModal .receipts-ledger-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
  #receiptsLedgerModal .receipts-ledger-table{min-width:620px;font-size:11px;}
  #receiptsLedgerModal .receipts-ledger-table th,#receiptsLedgerModal .receipts-ledger-table td{padding:4px 5px;white-space:nowrap;}
}

/* معاينة سند القبض على الجوال: حجم مضغوط بدل السند الكبير */
@media (max-width:760px){
  .receipt-paper{width:100%!important;max-width:100%!important;min-height:0!important;padding:12px 12px!important;border-width:1.5px!important;box-sizing:border-box!important;overflow:hidden;}
  .receipt-paper:before{margin-bottom:4px!important;}
  .receipt-paper .doc-letterhead .dl-band{gap:8px!important;padding:0 0 6px!important;}
  .receipt-paper .doc-letterhead .dl-logo{width:38px!important;height:38px!important;}
  .receipt-paper .doc-letterhead .dl-name{font-size:14px!important;}
  .receipt-paper .doc-letterhead .dl-sub{font-size:10px!important;}
  .receipt-paper .doc-letterhead .dl-doc{font-size:12px!important;padding:3px 8px!important;}
  .receipt-paper .doc-letterhead .dl-info{font-size:10px!important;}
  .receipt-paper .doc-letterhead .dl-rule i{height:3px!important;}
  .receipt-title{font-size:18px!important;padding-bottom:4px!important;line-height:1.3!important;}
  .receipt-row{grid-template-columns:86px minmax(0,1fr)!important;padding:5px 2px!important;font-size:12px!important;gap:6px!important;}
  .receipt-details{font-size:12px!important;}
  .receipt-signatures{margin-top:14px!important;gap:10px!important;}
  .receipt-signatures *{font-size:11px!important;}
  .sign-box{min-height:0!important;padding:6px!important;}
  .sign-box img{max-height:44px!important;}
  .resident-receipt-item{padding:8px!important;border-radius:10px!important;}
  .resident-receipt-item .receipt-paper{padding:10px!important;}
}

/* سندات الساكن على الجوال: نفس حجم سند القبض في شاشة السندات تمامًا (بدون قص أو تمدد) */
@media (max-width:760px){
  #residentReceiptsContent,.resident-receipts-content{grid-template-columns:minmax(0,1fr)!important;padding:4px 2px 14px!important;}
  .resident-receipt-item{min-width:0!important;width:100%!important;box-sizing:border-box!important;overflow:hidden!important;}
  .resident-receipt-item .receipt-paper,.resident-receipt-item .receipt-void-wrap{width:100%!important;max-width:100%!important;min-width:0!important;margin:0 auto!important;}
  .resident-receipt-item .receipt-void-wrap{overflow:hidden!important;}
  .resident-receipt-item .receipt-title{white-space:normal!important;}
  .resident-receipt-item-head{justify-content:center!important;}
}

/* لوحة المتابعة: ستيكرات السنة المختارة مميزة عن الستيكرات التراكمية */
.cards-scope{font-size:12.5px;font-weight:700;color:#475569;margin:4px 2px 6px;}
.cards-scope b{color:#0f3a36;font-weight:900;}
.smart-year-block{margin-top:12px;border:1px solid #e3c98f;background:linear-gradient(180deg,#fffaf0,#fff);border-radius:18px;padding:12px 14px;}
.smart-year-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;}
.smart-year-kicker{font-size:12.5px;font-weight:800;color:#7a5410;}
.smart-year-head b{background:#b8862f;color:#fff;border-radius:999px;padding:3px 14px;font-size:13px;font-weight:900;letter-spacing:.3px;}
.smart-year-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;}
.smart-year-grid .smart-metric-year{background:#fff;border:1px solid #efe1bd;border-right:4px solid #b8862f;border-radius:14px;padding:10px 12px;box-shadow:none;}
.smart-year-grid .smart-metric-year span{font-size:12.5px;font-weight:800;color:#7a5410;}
.smart-year-grid .smart-metric-year b{font-size:20px;color:#1f2a27;}
html[data-theme="dark"] .smart-year-block{background:linear-gradient(180deg,#221c10,#17130b);border-color:#6b5524;}
html[data-theme="dark"] .smart-year-grid .smart-metric-year{background:#13211e;border-color:#4a3c1c;}
html[data-theme="dark"] .smart-year-grid .smart-metric-year span{color:#e7c77f;}
html[data-theme="dark"] .smart-year-grid .smart-metric-year b{color:#f3f1e8;}
html[data-theme="dark"] .smart-year-head b{background:#b8862f;color:#1a1305;}

/* ===== لوحة المتابعة: تصميم احترافي وعناوين واضحة لكل قسم ===== */
#dashboardYearBadge{display:none!important;}
.smart-group-head{margin:0 0 12px;}
.smart-group-head h3{margin:0;font-size:19px;font-weight:900;color:#0f3a36;line-height:1.35;}
.smart-group-head h3 span{color:#8a6116;}
.smart-group-head p{margin:4px 0 0;font-size:13px;font-weight:600;color:#5b6b66;line-height:1.7;}
.smart-group-head-year h3{color:#7a5410;}
.smart-dashboard-metrics{gap:12px;}
.smart-dashboard-metrics .smart-metric{border-radius:16px;padding:14px 16px;border:1px solid #d9e5df;box-shadow:0 1px 2px rgba(8,34,32,.05);}
.smart-dashboard-metrics .smart-metric>span{font-size:15px;font-weight:900;color:#0f3a36;}
.smart-dashboard-metrics .smart-metric>b{font-size:32px;font-weight:900;margin:6px 0 4px;}
.smart-dashboard-metrics .smart-metric>small{font-size:12.5px;font-weight:700;color:#64748b;line-height:1.6;}
.smart-year-block{padding:16px 18px;border-radius:20px;}
.smart-year-grid{gap:12px;}
.smart-year-grid .smart-metric-year{padding:14px 16px;border-radius:16px;}
.smart-year-grid .smart-metric-year span{font-size:15px;font-weight:900;color:#7a5410;}
.smart-year-grid .smart-metric-year b{font-size:30px;font-weight:900;margin:6px 0 4px;}
.smart-year-grid .smart-metric-year small{font-size:12.5px;font-weight:700;color:#7a6a4b;}
html[data-theme="dark"] .smart-group-head h3{color:#e6f2ec;}
html[data-theme="dark"] .smart-group-head h3 span{color:#e7c77f;}
html[data-theme="dark"] .smart-group-head p{color:#9fb5ad;}
html[data-theme="dark"] .smart-group-head-year h3{color:#e7c77f;}
html[data-theme="dark"] .smart-dashboard-metrics .smart-metric>span{color:#e6f2ec;}
html[data-theme="dark"] .smart-dashboard-metrics .smart-metric>small{color:#9fb5ad;}
html[data-theme="dark"] .smart-year-grid .smart-metric-year small{color:#c9b98f;}
@media (max-width:560px){
  .smart-group-head h3{font-size:17px;}
  .smart-dashboard-metrics .smart-metric>b{font-size:26px;}
  .smart-year-grid .smart-metric-year b{font-size:24px;}
}
@media (max-width:560px){
  .smart-year-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}
  .smart-year-grid .smart-metric-year{padding:11px 12px;}
  .smart-year-grid .smart-metric-year span{font-size:13px;}
  .smart-year-grid .smart-metric-year b{font-size:21px;}
  .smart-year-grid .smart-metric-year small{font-size:11.5px;}
}

/* جدول المدفوعات: خانة المتأخرات */
#paymentsWrap .arr-col{width:112px;}
#paymentsWrap .arr-cell{font-weight:900;text-align:center;white-space:nowrap;font-size:14px;}
#paymentsWrap .arr-cell.arr-due{color:#a3361f;background:#fdf1ee;}
#paymentsWrap .arr-cell.arr-ok{color:#1f6e3d;background:#f1faf4;}
html[data-theme="dark"] #paymentsWrap .arr-cell.arr-due{color:#ffb4a2;background:#3a1d17;}
html[data-theme="dark"] #paymentsWrap .arr-cell.arr-ok{color:#9fe0b8;background:#13291e;}

/* المتأخرات: ستيكرات السنة وكل السنوات + بطاقات السكان */
.smart-group-head-cum h3{color:#0f3a36;}
.smart-cum-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));}
.smart-metric-arrears-all{border-right:4px solid #a3361f!important;}
.smart-metric-rate-all{border-right:4px solid #1f6e3d!important;}
.smart-year-grid .smart-metric-arrears b{color:#a3361f!important;}
.pc-ar{display:inline-flex;flex-direction:column;align-items:center;min-width:72px;padding:3px 10px;border-radius:12px;line-height:1.2;}
.pc-ar small{font-size:10.5px;font-weight:800;opacity:.85;}
.pc-ar b{font-size:14px;font-weight:900;}
.pc-ar.due{background:#fdf1ee;color:#a3361f;border:1px solid #f0c4b8;}
.pc-ar.ok{background:#f1faf4;color:#1f6e3d;border:1px solid #c9e8d4;}
.pc-sum-arr{padding:4px 10px;border-radius:999px;font-weight:800;}
.pc-sum-arr b{font-weight:900;}
.pc-sum-arr.due{background:#fdf1ee;color:#a3361f;}
.pc-sum-arr.ok{background:#f1faf4;color:#1f6e3d;}
html[data-theme="dark"] .pc-ar.due,html[data-theme="dark"] .pc-sum-arr.due{background:#3a1d17;color:#ffb4a2;border-color:#6b3a2e;}
html[data-theme="dark"] .pc-ar.ok,html[data-theme="dark"] .pc-sum-arr.ok{background:#13291e;color:#9fe0b8;border-color:#2e5a40;}
.pc-ar{flex-direction:row!important;gap:5px;white-space:nowrap;align-items:center;}
.pc-ar small{font-size:11px;}

/* ===== تحديث 96: ستيكرا المتأخرات والتحصيل التراكميين ضمن شريط الأرقام الرئيسي ===== */
html body #appView .main .cards{grid-template-columns:repeat(8,minmax(0,1fr))!important;gap:10px;}
.main .cards .card.c-arr{background:#fdecec!important;border-color:#efb4b4!important;color:#9b2226!important;--card-accent:#b42318;--card-ink:#9b2226;}
.main .cards .card.c-rate{background:#e3f5f1!important;border-color:#9fd8cc!important;color:#0f5f57!important;--card-accent:#0f7a6e;--card-ink:#0f5f57;}
.main .cards .card.c-arr b,.main .cards .card.c-rate b{color:inherit;}
html[data-theme="dark"] .main .cards .card.c-arr{background:#3a1f22!important;border-color:#5c2f35!important;color:#f4b4b4!important;}
html[data-theme="dark"] .main .cards .card.c-rate{background:#15302d!important;border-color:#2b5a53!important;color:#a8e6d9!important;}
@media (max-width:1280px){html body #appView .main .cards{grid-template-columns:repeat(4,minmax(0,1fr))!important;}}
@media (max-width:700px){html body #appView .main .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}}

/* ===== تحديث 97: الأشهر خارج فترة سكن الساكن (لا تُحسب ولا تُدخل) ===== */
.pay-cell.month-outside,.pc-m.outside{background:repeating-linear-gradient(135deg,#f1f5f9 0 6px,#e2e8f0 6px 12px)!important;color:#64748b!important;}
.pay-cell.month-outside{font-size:10px;font-weight:700;line-height:1.25;padding:4px 2px;text-align:center;vertical-align:middle;}
.pc-m.outside{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:1px dashed #cbd5e1;border-radius:10px;padding:6px;min-height:52px;}
.pc-m.outside span{font-weight:800;font-size:12px;}
.pc-m.outside em{font-style:normal;font-size:10.5px;font-weight:700;}
.rp-outside{background:#f1f5f9;color:#94a3b8;font-weight:700;text-align:center;}
html[data-theme="dark"] .pay-cell.month-outside,html[data-theme="dark"] .pc-m.outside{background:repeating-linear-gradient(135deg,#1e293b 0 6px,#273449 6px 12px)!important;color:#94a3b8!important;border-color:#334155;}
html[data-theme="dark"] .rp-outside{background:#1e293b;color:#64748b;}

/* ===== تحديث 98: لوحة المتابعة الذكية كتبويب واحد موحّد ===== */
.smart-dashboard.sd-panel{padding:24px 24px 20px;border-radius:24px;}
.sd-head{display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;padding-bottom:16px;border-bottom:1px solid #dfe7f1;margin-bottom:4px;}
.sd-head h2{margin:0;font-size:27px;font-weight:900;line-height:1.3;color:#0f3a36;}
.sd-sub{margin:0;font-size:15.5px;font-weight:800;color:#a8752a;}
.sd-sec{padding:18px 0;border-bottom:1px solid #eef2f7;}
.sd-sec:last-child{border-bottom:0;padding-bottom:4px;}
.sd-sec-head{margin-bottom:12px;}
.sd-sec-head h3{margin:0 0 3px;font-size:19px;font-weight:900;color:#0f3a36;}
.sd-sec-head p{margin:0;font-size:13px;font-weight:600;color:#64748b;}
.sd-two{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.smart-year-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;}
.sd-panel .ssb-chart-card,.sd-panel #ssbChartCard{border:0!important;box-shadow:none!important;background:transparent!important;padding:0!important;margin:0!important;}
.sd-panel .ssb-chart-head h3{font-size:19px;font-weight:900;color:#0f3a36;}
@media (max-width:1100px){.smart-year-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media (max-width:640px){.smart-dashboard.sd-panel{padding:18px 14px 14px;}.sd-head h2{font-size:23px;}.smart-year-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.sd-two{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
html[data-theme="dark"] .sd-head,html[data-theme="dark"] .sd-sec{border-color:#2a3a48;}
html[data-theme="dark"] .sd-head h2,html[data-theme="dark"] .sd-sec-head h3,html[data-theme="dark"] .sd-panel .ssb-chart-head h3{color:#e8eef0!important;}
html[data-theme="dark"] .sd-sec-head p{color:#94a3b8;}
html[data-theme="dark"] .sd-sub{color:#d4a95c;}
@media (max-width:640px){
  .sd-two{grid-template-columns:minmax(0,1fr)!important;}
  .sd-panel .smart-metric{min-height:0!important;overflow:visible!important;}
  .sd-panel .smart-metric small{line-height:1.4;}
  .sd-panel .smart-metric-arrears{grid-column:1/-1;}
}

/* ===== تحديث 101: بيانات السكان: حالة السكن، أشهر عدم السكن، وزر الحفظ ===== */
#residentsMasterModal .res-master-actions{display:flex;gap:8px;align-items:center;flex:0 0 auto;}
#residentsMasterModal .res-master-head>.res-master-actions>button{min-height:40px;padding:0 18px;border-radius:12px;font-weight:800;font-size:14px;white-space:nowrap;}
#residentsMasterModal .res-save-btn{border:0;background:linear-gradient(135deg,#0f3a36,#1c6a60);color:#fff;box-shadow:0 6px 16px rgba(15,58,54,.25);cursor:pointer;}
#residentsMasterModal .res-save-btn:hover{filter:brightness(1.08);}
#residentsMasterModal .res-save-btn span{margin-left:4px;}
.rs-status{padding-top:14px;}
.rs-check{position:relative;display:flex;gap:12px;align-items:flex-start;cursor:pointer;padding:12px 14px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc;}
.rs-check input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none;}
.rs-check-box{flex:0 0 22px;width:22px;height:22px;border:2px solid #94a3b8;border-radius:7px;background:#fff;position:relative;margin-top:1px;}
.rs-check input:checked + .rs-check-box{background:#0f3a36;border-color:#0f3a36;}
.rs-check input:checked + .rs-check-box::after{content:"";position:absolute;left:6px;top:2px;width:6px;height:11px;border:solid #fff;border-width:0 2.5px 2.5px 0;transform:rotate(45deg);}
.rs-check input:focus-visible + .rs-check-box{outline:3px solid #b8862f;outline-offset:2px;}
.rs-check-txt{display:flex;flex-direction:column;gap:3px;}
.rs-check-txt b{font-size:14.5px;font-weight:900;color:#0f172a;}
.rs-check-txt small{font-size:12.5px;color:#64748b;line-height:1.5;}
.rs-away{margin-top:12px;padding:14px;border:1px dashed #cbd5e1;border-radius:14px;background:#fff;}
.rs-away-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex-wrap:wrap;margin-bottom:12px;}
.rs-away-top b{display:block;font-size:14.5px;font-weight:900;color:#0f172a;}
.rs-away-top small{display:block;font-size:12.5px;color:#64748b;margin-top:2px;line-height:1.5;}
.rs-away-y{display:flex;flex-direction:column;gap:4px;}
.rs-away-y span{font-size:12px;font-weight:800;color:#475569;}
.rs-away-y select{min-height:38px;border-radius:10px;border:1px solid #cbd5e1;padding:0 10px;font-weight:800;background:#fff;}
.rs-away-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.rs-m{min-height:42px;border-radius:11px;border:1px solid #cbd5e1;background:#f8fafc;color:#334155;font-weight:800;font-size:13px;cursor:pointer;transition:background .15s,border-color .15s,transform .1s;}
.rs-m:hover{border-color:#94a3b8;}
.rs-m:active{transform:scale(.97);}
.rs-m.on{background:linear-gradient(135deg,#fde68a,#f59e0b);border-color:#d97706;color:#78350f;box-shadow:0 3px 10px rgba(217,119,6,.25);}
.rs-away-empty{grid-column:1/-1;font-size:13px;color:#64748b;text-align:center;padding:10px;}
.pay-cell.month-away{background:repeating-linear-gradient(135deg,#fff7ed 0 6px,#fed7aa 6px 12px)!important;color:#9a3412!important;font-size:10px;font-weight:800;line-height:1.25;}
.pc-m.away{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:1px dashed #fdba74;border-radius:10px;padding:6px;min-height:52px;background:repeating-linear-gradient(135deg,#fff7ed 0 6px,#fed7aa 6px 12px)!important;color:#9a3412!important;}
.pc-m.away span{font-weight:800;font-size:12px;}
.pc-m.away em{font-style:normal;font-size:10.5px;font-weight:800;}
@media (max-width:560px){.rs-away-grid{grid-template-columns:repeat(3,minmax(0,1fr));}#residentsMasterModal .res-master-head{flex-wrap:wrap;}}
html[data-theme="dark"] .rs-check{background:#16242b;border-color:#2a3a48;}
html[data-theme="dark"] .rs-check-txt b,html[data-theme="dark"] .rs-away-top b{color:#e8eef0;}
html[data-theme="dark"] .rs-check-txt small,html[data-theme="dark"] .rs-away-top small{color:#94a3b8;}
html[data-theme="dark"] .rs-check-box{background:#0f1b20;border-color:#64748b;}
html[data-theme="dark"] .rs-away{background:#121e24;border-color:#2a3a48;}
html[data-theme="dark"] .rs-m{background:#16242b;border-color:#2a3a48;color:#cbd5e1;}
html[data-theme="dark"] .rs-m.on{background:linear-gradient(135deg,#b45309,#d97706);color:#fff;border-color:#f59e0b;}
html[data-theme="dark"] .pay-cell.month-away,html[data-theme="dark"] .pc-m.away{color:#fdba74!important;background:repeating-linear-gradient(135deg,#2a1d12 0 6px,#3b2716 6px 12px)!important;}

/* ===== تحديث 102: تنظيم بيانات الساكن، وتثبيت أزرار الحفظ والإغلاق ===== */
body:has(#residentsMasterModal.active) #saveBtn,
body:has(#residentsMasterModal.active) .bottom-nav{visibility:hidden!important;}
#residentsMasterModal .modal-box.res-master-box{max-height:calc(100vh - 30px);max-height:calc(100dvh - 30px);overflow-y:auto;overscroll-behavior:contain;padding:0 0 14px;width:min(860px,96vw);}
#residentsMasterModal .res-master-head{position:sticky;top:0;z-index:30;margin:0;padding:14px 18px 12px;background:#fffdf8;border-bottom:1px solid #e3ebe7;box-shadow:0 8px 16px -14px rgba(8,34,32,.5);align-items:center;}
#residentsMasterModal .res-master-head h2{font-size:19px;margin:0 0 2px;}
#residentsMasterModal .res-master-head p{font-size:12px;line-height:1.5;margin:0;}
#residentsMasterModal #ssbResRoot{padding:12px 16px 0;}
#residentsMasterModal .set-res-list{gap:8px!important;margin-top:4px;}
#residentsMasterModal .set-res-head{padding:10px 12px!important;}
#residentsMasterModal .set-res-n{flex:0 0 28px!important;width:28px!important;height:28px!important;font-size:12.5px;}
#residentsMasterModal .srh-name{font-size:15px!important;}
#residentsMasterModal .srh-sub{font-size:12px!important;}
#residentsMasterModal .rs-body{padding:12px!important;display:flex;flex-direction:column;gap:10px;}
#residentsMasterModal .rs-card{border:1px solid #e3ebe7;border-radius:14px;background:#fbfcfb;padding:12px;min-width:0;}
#residentsMasterModal .rs-card-t{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:13.5px;font-weight:900;color:#0f3a36;}
#residentsMasterModal .rs-card-t i{width:22px;height:22px;border-radius:50%;background:#0f3a36;color:#fff;font-style:normal;display:grid;place-items:center;font-size:11.5px;flex:0 0 22px;}
#residentsMasterModal .rs-row2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:start;}
#residentsMasterModal .rs-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
#residentsMasterModal .rs-f{gap:3px;}
#residentsMasterModal .rs-f>span{font-size:11.5px;font-weight:800;color:#475569;}
#residentsMasterModal .rs-f input,#residentsMasterModal .rs-f select{height:36px;min-height:36px;font-size:13px;padding:0 9px;border-radius:10px;}
#residentsMasterModal .rs-span2{grid-column:1/-1;}
#residentsMasterModal .rs-hint{font-size:11.5px;margin:8px 0 0;color:#64748b;line-height:1.5;}
#residentsMasterModal .rs-check{padding:10px 12px;}
#residentsMasterModal .rs-check-txt b{font-size:13px;}
#residentsMasterModal .rs-check-txt small{font-size:11.5px;}
#residentsMasterModal .rs-away{margin-top:10px;padding:10px;}
#residentsMasterModal .rs-away-top{margin-bottom:6px;}
#residentsMasterModal .rs-away-top b{font-size:13px;}
#residentsMasterModal .rs-away-note{font-size:11.5px;color:#64748b;margin:0 0 8px;line-height:1.5;}
#residentsMasterModal .rs-away-y select{min-height:32px;height:32px;font-size:12.5px;}
#residentsMasterModal .rs-away-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;}
#residentsMasterModal .rs-m{min-height:32px;font-size:11.5px;border-radius:9px;padding:0 2px;}
#residentsMasterModal .rs-foot{padding:0!important;border:0!important;justify-content:flex-end;gap:8px;}
#residentsMasterModal .rs-foot .rs-btn{min-height:34px;font-size:12.5px;padding:0 12px;}
@media (max-width:760px){
  #residentsMasterModal .rs-row2{grid-template-columns:minmax(0,1fr);}
  #residentsMasterModal .rs-away-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media (max-width:560px){
  #residentsMasterModal .modal-box.res-master-box{width:97vw;}
  #residentsMasterModal .res-master-head{flex-wrap:wrap;gap:10px;}
  #residentsMasterModal #ssbResRoot{padding:10px 10px 0;}
  #residentsMasterModal .rs-grid{grid-template-columns:minmax(0,1fr);}
}
html[data-theme="dark"] #residentsMasterModal .res-master-head{background:#0f1b20;border-color:#2a3a48;}
html[data-theme="dark"] #residentsMasterModal .rs-card{background:#121e24;border-color:#2a3a48;}
html[data-theme="dark"] #residentsMasterModal .rs-card-t{color:#e8eef0;}
html[data-theme="dark"] #residentsMasterModal .rs-card-t i{background:#2c8a7a;}
html[data-theme="dark"] #residentsMasterModal .rs-f>span{color:#94a3b8;}

/* ===== تحديث 102 (تنسيق مطابق لنوافذ التقارير وسندات القبض) ===== */
#residentsMasterModal .res-master-head{background:linear-gradient(135deg,#0f3a36 0%,#164e47 100%)!important;border-bottom:3px solid #b8862f!important;border-radius:0;padding:14px 16px 13px!important;box-shadow:0 8px 18px -12px rgba(8,34,32,.6)!important;}
#residentsMasterModal .res-master-head h2{color:#fff!important;font-size:19px!important;}
#residentsMasterModal .res-master-head h2::after{background:#d4a95c!important;}
#residentsMasterModal .res-master-head p{color:#cfe6de!important;}
#residentsMasterModal .res-master-actions .secondary{background:rgba(255,255,255,.12)!important;color:#fff!important;border:1px solid rgba(255,255,255,.35)!important;box-shadow:none!important;}
#residentsMasterModal .res-save-btn{background:linear-gradient(135deg,#d4a95c,#a8752a)!important;color:#fff!important;box-shadow:0 6px 16px rgba(0,0,0,.25)!important;}
#residentsMasterModal #ssbResRoot>.set-card{border:0!important;box-shadow:none!important;background:transparent!important;padding:0!important;}
#residentsMasterModal #ssbResRoot .set-head h3{font-size:17px;}
html body #residentsMasterModal .rs-f input,html body #residentsMasterModal .rs-f select,html body #setAddForm .rs-f input,html body #setAddForm .rs-f select{height:38px!important;min-height:38px!important;font-size:14px!important;padding:0 10px!important;}
html body #residentsMasterModal .rs-f>span,html body #setAddForm .rs-f>span{font-size:12px!important;}
html body #residentsMasterModal .rs-away-grid .rs-m{font-size:12px!important;min-height:36px!important;height:36px!important;padding:0 2px!important;white-space:nowrap;}
@media (max-width:560px){
  html body #residentsMasterModal .rs-away-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  html body #residentsMasterModal .rs-away-grid .rs-m{font-size:12.5px!important;}
  html body #residentsMasterModal .rs-f input,html body #residentsMasterModal .rs-f select,html body #setAddForm .rs-f input,html body #setAddForm .rs-f select{height:36px!important;min-height:36px!important;font-size:13.5px!important;}
}

/* ===== update 103: لوحة المتابعة الذكية — ستيكرات السنة المختارة بحجم وتصميم موحد ===== */
.sd-panel #smartYearBlock{padding:0!important;border:0!important;}
.sd-panel #smartYearBlock .sd-sec-head{margin-bottom:14px;}
html body .sd-panel .smart-year-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;align-items:stretch;}
html body .sd-panel .smart-year-grid .smart-metric-year{
  display:flex!important;flex-direction:column;justify-content:flex-start;
  min-height:128px;height:auto;min-width:0;overflow:visible!important;
  padding:14px 16px!important;margin:0!important;
  border-radius:16px!important;border:1px solid #d9e5df!important;border-right:4px solid #0f766e!important;
  background:#fff!important;box-shadow:0 1px 2px rgba(8,34,32,.05)!important;
}
html body .sd-panel .smart-year-grid .smart-metric-year>span{
  display:block;font-size:14px!important;font-weight:900!important;color:#0f3a36!important;
  line-height:1.5!important;white-space:normal!important;overflow:visible!important;word-break:keep-all;
  margin:0 0 6px!important;min-height:42px;
}
html body .sd-panel .smart-year-grid .smart-metric-year>b{
  display:block;font-size:26px!important;font-weight:900!important;line-height:1.2!important;
  color:#1f2a27!important;margin:auto 0 6px!important;white-space:nowrap;overflow:visible!important;
  direction:ltr;text-align:right;
}
html body .sd-panel .smart-year-grid .smart-metric-year>small{
  display:block;font-size:12px!important;font-weight:700!important;line-height:1.5!important;
  color:#64748b!important;white-space:normal!important;overflow:visible!important;margin:0!important;
}
html body .sd-panel .smart-year-grid .smart-metric-arrears{border-right-color:#a3361f!important;}
html body .sd-panel .smart-year-grid .smart-metric-arrears>b{color:#a3361f!important;}
html body .sd-panel .smart-year-grid .smart-metric-year>b#dashboardCoverage{direction:ltr;}
html[data-theme="dark"] body .sd-panel .smart-year-grid .smart-metric-year{background:#13211e!important;border-color:#2a3a48!important;}
html[data-theme="dark"] body .sd-panel .smart-year-grid .smart-metric-year>span{color:#e6f2ec!important;}
html[data-theme="dark"] body .sd-panel .smart-year-grid .smart-metric-year>b{color:#f3f1e8!important;}
html[data-theme="dark"] body .sd-panel .smart-year-grid .smart-metric-year>small{color:#9fb5ad!important;}
html[data-theme="dark"] body .sd-panel .smart-year-grid .smart-metric-arrears>b{color:#f0a48f!important;}
@media (max-width:1100px){html body .sd-panel .smart-year-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}}
@media (max-width:760px){
  html body .sd-panel .smart-year-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
  html body .sd-panel .smart-year-grid .smart-metric-year{min-height:118px;padding:12px 12px!important;}
  html body .sd-panel .smart-year-grid .smart-metric-year>span{font-size:13px!important;min-height:40px;}
  html body .sd-panel .smart-year-grid .smart-metric-year>b{font-size:22px!important;}
  html body .sd-panel .smart-year-grid .smart-metric-year>small{font-size:11.5px!important;}
  html body .sd-panel .smart-year-grid .smart-metric-year:last-child:nth-child(odd){grid-column:1/-1;}
}
@media (max-width:420px){html body .sd-panel .smart-year-grid .smart-metric-year>b{font-size:20px!important;}}

/* update 103: التقرير العام — ستة بطاقات تشمل المتأخرات */
html body .report-year .report-cards{grid-template-columns:repeat(6,minmax(0,1fr))!important;}
@media (max-width:760px){html body .report-year .report-cards{grid-template-columns:repeat(3,minmax(0,1fr))!important;}}
@media (max-width:420px){html body .report-year .report-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media print{html body .report-year .report-cards{grid-template-columns:repeat(6,minmax(0,1fr))!important;}}
/* update 103 (تثبيت): شريط علوي موحد لكل الستيكرات وارتفاع متساوٍ */
html body .sd-panel .smart-year-grid{grid-auto-rows:1fr!important;}
html body .sd-panel .smart-year-grid .smart-metric-year{border-right:1px solid #d9e5df!important;border-top:0!important;}
html body .sd-panel .smart-year-grid .smart-metric-year:before{content:""!important;display:block!important;position:absolute!important;top:0!important;left:0!important;right:0!important;height:4px!important;background:#0f766e!important;border-radius:16px 16px 0 0;}
html body .sd-panel .smart-year-grid .smart-metric-arrears{border-right:1px solid #d9e5df!important;}
html body .sd-panel .smart-year-grid .smart-metric-arrears:before{background:#a3361f!important;}
html body .sd-panel .smart-year-grid .smart-metric-year>b{color:#1f2a27!important;}
html body .sd-panel .smart-year-grid .smart-metric-arrears>b{color:#a3361f!important;}
html[data-theme="dark"] body .sd-panel .smart-year-grid .smart-metric-year>b{color:#f3f1e8!important;}
html[data-theme="dark"] body .sd-panel .smart-year-grid .smart-metric-arrears>b{color:#f0a48f!important;}
html body .sd-panel .smart-year-grid .smart-metric-year{position:relative!important;overflow:hidden!important;}
@media (max-width:760px){html body .sd-panel .smart-year-grid .smart-metric-year{min-height:124px!important;}}

/* ===================================================================
   update 104 — نظام ستيكرات موحد (كل الشاشات والتقارير، ويب وأندرويد)
   حجم أصغر، خلفية وحدود وخط واحد، النص في المنتصف، بدون قص
   =================================================================== */
:root{
  --stk-bg:#ffffff;
  --stk-bd:#dfe8e3;
  --stk-accent:#0f766e;
  --stk-alert:#a3361f;
  --stk-label:#0f3a36;
  --stk-value:#1f2a27;
  --stk-note:#64748b;
  --stk-gap:8px;
}
html[data-theme="dark"]{
  --stk-bg:#13211e;
  --stk-bd:#2a3a48;
  --stk-accent:#2dd4bf;
  --stk-alert:#f0a48f;
  --stk-label:#e6f2ec;
  --stk-value:#f3f1e8;
  --stk-note:#9fb5ad;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --stk-bg:#13211e;--stk-bd:#2a3a48;--stk-accent:#2dd4bf;--stk-alert:#f0a48f;
    --stk-label:#e6f2ec;--stk-value:#f3f1e8;--stk-note:#9fb5ad;
  }
}

/* الشبكات */
html body #summaryCards{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:var(--stk-gap)!important;}
html body .sd-panel .smart-year-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:var(--stk-gap)!important;grid-auto-rows:1fr!important;}
html body .report-year .report-cards{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:var(--stk-gap)!important;}

/* الستيكر نفسه */
html body #summaryCards .card,
html body .sd-panel .smart-year-grid .smart-metric,
html body .smart-dashboard-metrics .smart-metric,
html body .report-year .report-card,
html body .resident-summary-card,
html body .monitor-kpi,
html body .security-stat,
html body .arr-cards>*,
html body .resident-report-cards>*{
  position:relative!important;display:flex!important;flex-direction:column!important;
  align-items:center!important;justify-content:center!important;text-align:center!important;
  box-sizing:border-box!important;min-width:0!important;min-height:76px!important;height:auto!important;
  margin:0!important;padding:8px 8px!important;overflow:visible!important;
  background:var(--stk-bg)!important;color:var(--stk-label)!important;
  border:1px solid var(--stk-bd)!important;border-top:3px solid var(--stk-accent)!important;
  border-radius:12px!important;box-shadow:0 1px 2px rgba(8,34,32,.05)!important;
  line-height:1.35!important;
}
html body #summaryCards .card::before,html body #summaryCards .card::after,
html body .sd-panel .smart-year-grid .smart-metric::before,html body .sd-panel .smart-year-grid .smart-metric::after,
html body .smart-dashboard-metrics .smart-metric::before,html body .report-year .report-card::before,
html body .resident-summary-card::before,html body .monitor-kpi::before,html body .security-stat::before{display:none!important;content:none!important;}

/* النص داخل الستيكر */
html body #summaryCards .card b,
html body .sd-panel .smart-year-grid .smart-metric>b,
html body .smart-dashboard-metrics .smart-metric>b,
html body .report-year .report-card b,
html body .resident-summary-card b,
html body .monitor-kpi b,
html body .security-stat b,
html body .arr-cards>* b,
html body .resident-report-cards>* b{
  display:block!important;font-size:16px!important;font-weight:900!important;line-height:1.2!important;
  margin:3px 0 2px!important;color:var(--stk-value)!important;text-align:center!important;
  direction:ltr!important;white-space:nowrap!important;overflow:visible!important;
}
html body .sd-panel .smart-year-grid .smart-metric>span,
html body .smart-dashboard-metrics .smart-metric>span,
html body .resident-summary-card span,
html body .monitor-kpi span,
html body .security-stat span{
  display:block!important;font-size:11.5px!important;font-weight:800!important;line-height:1.4!important;
  color:var(--stk-label)!important;white-space:normal!important;overflow:visible!important;margin:0!important;text-align:center!important;
}
html body .sd-panel .smart-year-grid .smart-metric>small,
html body .smart-dashboard-metrics .smart-metric>small,
html body .resident-summary-card small,
html body .monitor-kpi small,
html body .security-stat small{
  display:block!important;font-size:10px!important;font-weight:600!important;line-height:1.4!important;
  color:var(--stk-note)!important;white-space:normal!important;overflow:visible!important;margin:0!important;text-align:center!important;
}
/* ستيكرات المتأخرات بتمييز أحمر واحد فقط */
html body #summaryCards .card.c-arr,
html body .sd-panel .smart-year-grid .smart-metric-arrears,
html body .report-year .report-card-arrears,
html body .report-year .report-card-arrears{border-top-color:var(--stk-alert)!important;}
html body #summaryCards .card.c-arr b,
html body .sd-panel .smart-year-grid .smart-metric-arrears>b,
html body .report-year .report-card-arrears b{color:var(--stk-alert)!important;}
/* ستيكر المتأخرات في الجوال يأخذ العرض الكامل ليكون الأخير ظاهراً بوضوح */

/* الجوال */
@media (min-width:1101px){html body .sd-panel .smart-year-grid{grid-template-columns:repeat(7,minmax(0,1fr))!important;}}
@media (max-width:760px){
  html body .sd-panel .smart-year-grid .smart-metric-year:last-child:nth-child(odd){grid-column:1/-1!important;}
  html body #summaryCards{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  html body .sd-panel .smart-year-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  html body .report-year .report-cards{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  html body #summaryCards .card,html body .sd-panel .smart-year-grid .smart-metric,html body .report-year .report-card{min-height:70px!important;padding:7px 6px!important;}
  html body #summaryCards .card b,html body .sd-panel .smart-year-grid .smart-metric>b,html body .report-year .report-card b{font-size:15px!important;}
}
@media (max-width:420px){
  html body .report-year .report-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media print{
  html body .report-year .report-cards{grid-template-columns:repeat(6,minmax(0,1fr))!important;}
  html body .report-year .report-card{-webkit-print-color-adjust:exact;print-color-adjust:exact;}
}

/* ===================================================================
   update 105 — توحيد نهائي لكل الستيكرات (الحجم، اللون، الخط، الترتيب)
   نفس المقاسات على الجوال والحاسوب، وكل الشاشات والتبويبات والتقارير
   =================================================================== */
:root{
  --stk-bg:#ffffff;
  --stk-bd:#dfe8e3;
  --stk-accent:#0f766e;
  --stk-alert:#a3361f;
  --stk-label:#0f3a36;
  --stk-value:#1f2a27;
  --stk-note:#64748b;
  --stk-min-h:84px;
  --stk-gap:8px;
  --stk-lbl-fs:12.5px;
  --stk-val-fs:18px;
  --stk-note-fs:11px;
  --stk-font:inherit;
}
html[data-theme="dark"]{
  --stk-bg:#13211e;--stk-bd:#2a3a48;--stk-accent:#2dd4bf;--stk-alert:#f0a48f;
  --stk-label:#e6f2ec;--stk-value:#f3f1e8;--stk-note:#9fb5ad;
}

/* الشبكات — عدد الأعمدة حسب عرض الشاشة */
html body #summaryCards,
html body .ssb-mini-sum,
html body .sd-panel .smart-year-grid,
html body .report-year .report-cards,
html body .arr-cards,
html body .resident-report-cards{
  display:grid!important;gap:var(--stk-gap)!important;align-items:stretch!important;
}
html body #summaryCards{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
html body .ssb-mini-sum{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
html body .sd-panel .smart-year-grid{grid-template-columns:repeat(7,minmax(0,1fr))!important;grid-auto-rows:1fr!important;}
html body .report-year .report-cards{grid-template-columns:repeat(6,minmax(0,1fr))!important;}

/* الستيكر نفسه */
html body #summaryCards .card,
html body .ssb-mini-sum .mini-tile,
html body .sd-panel .smart-year-grid .smart-metric,
html body .smart-dashboard-metrics .smart-metric,
html body .report-year .report-card,
html body .resident-summary-card,
html body .monitor-kpi,
html body .security-stat,
html body .arr-cards>*,
html body .resident-report-cards>*{
  position:relative!important;display:flex!important;flex-direction:column!important;
  align-items:center!important;justify-content:center!important;text-align:center!important;
  box-sizing:border-box!important;min-width:0!important;width:100%!important;
  min-height:var(--stk-min-h)!important;height:auto!important;margin:0!important;
  padding:10px 8px!important;overflow:visible!important;gap:3px!important;
  background:var(--stk-bg)!important;color:var(--stk-label)!important;
  font-family:var(--stk-font)!important;line-height:1.35!important;
  border:1px solid var(--stk-bd)!important;border-top:3px solid var(--stk-accent)!important;
  border-radius:12px!important;box-shadow:0 1px 2px rgba(8,34,32,.06)!important;
  background-image:none!important;filter:none!important;
}
html body #summaryCards .card::before,html body #summaryCards .card::after,
html body .ssb-mini-sum .mini-tile::before,html body .ssb-mini-sum .mini-tile::after,
html body .sd-panel .smart-year-grid .smart-metric::before,html body .sd-panel .smart-year-grid .smart-metric::after,
html body .smart-dashboard-metrics .smart-metric::before,html body .report-year .report-card::before,
html body .resident-summary-card::before,html body .monitor-kpi::before,html body .security-stat::before{display:none!important;content:none!important;}

/* النص داخل الستيكر — نفس الخط والحجم في كل مكان */
html body #summaryCards .card>*,
html body .ssb-mini-sum .mini-tile>*,
html body .sd-panel .smart-year-grid .smart-metric>*,
html body .smart-dashboard-metrics .smart-metric>*,
html body .report-year .report-card>*,
html body .resident-summary-card>*,
html body .monitor-kpi>*,
html body .security-stat>*,
html body .arr-cards>*>*,
html body .resident-report-cards>*>*{
  margin:0!important;max-width:100%!important;white-space:normal!important;overflow:visible!important;text-align:center!important;
}
html body #summaryCards .card b,html body .ssb-mini-sum .mini-tile b,
html body .sd-panel .smart-year-grid .smart-metric>b,html body .smart-dashboard-metrics .smart-metric>b,
html body .report-year .report-card b,html body .resident-summary-card b,
html body .monitor-kpi b,html body .security-stat b,
html body .arr-cards>* b,html body .resident-report-cards>* b{
  display:block!important;font-size:var(--stk-val-fs)!important;font-weight:900!important;line-height:1.2!important;
  color:var(--stk-value)!important;direction:ltr!important;white-space:nowrap!important;
  font-family:var(--stk-font)!important;
}
html body .ssb-mini-sum .mini-tile>span,html body .sd-panel .smart-year-grid .smart-metric>span,
html body .smart-dashboard-metrics .smart-metric>span,html body .resident-summary-card span,
html body .monitor-kpi span,html body .security-stat span{
  display:block!important;font-size:var(--stk-lbl-fs)!important;font-weight:800!important;line-height:1.4!important;
  color:var(--stk-label)!important;font-family:var(--stk-font)!important;
}
html body .sd-panel .smart-year-grid .smart-metric>small,html body .smart-dashboard-metrics .smart-metric>small,
html body .resident-summary-card small,html body .monitor-kpi small,html body .security-stat small{
  display:block!important;font-size:var(--stk-note-fs)!important;font-weight:600!important;line-height:1.4!important;
  color:var(--stk-note)!important;font-family:var(--stk-font)!important;
}
/* المتأخرات وحدها بالأحمر */
html body #summaryCards .card.c-arr,html body .sd-panel .smart-year-grid .smart-metric-arrears,
html body .report-year .report-card-arrears,html body .ssb-mini-sum .mini-tile.cnt,
html body .ssb-mini-sum .mini-tile.arr,html body .ssb-mini-sum .mini-tile.exp{border-top-color:var(--stk-accent)!important;}
html body #summaryCards .card.c-arr,html body .sd-panel .smart-year-grid .smart-metric-arrears,html body .report-year .report-card-arrears{border-top-color:var(--stk-alert)!important;}
html body #summaryCards .card.c-arr b,html body .sd-panel .smart-year-grid .smart-metric-arrears>b,
html body .report-year .report-card-arrears b{color:var(--stk-alert)!important;}

/* الجوال — نفس الأحجام تقريباً، عمودان */
@media (max-width:760px){
  html body #summaryCards,html body .ssb-mini-sum,html body .sd-panel .smart-year-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  html body .report-year .report-cards{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  html body .sd-panel .smart-year-grid .smart-metric-year:last-child:nth-child(odd){grid-column:1/-1!important;}
}
@media (max-width:420px){
  html body .report-year .report-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media (min-width:761px) and (max-width:1100px){
  html body .sd-panel .smart-year-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
}
@media print{
  html body .report-year .report-cards{grid-template-columns:repeat(6,minmax(0,1fr))!important;}
  html body .report-year .report-card{-webkit-print-color-adjust:exact;print-color-adjust:exact;}
}
/* update 105 — إعادة تأكيد المقاسات نفسها على الجوال والحاسوب (تتغلب على أي قواعد جوال قديمة) */
html body #summaryCards .card b,html body .ssb-mini-sum .mini-tile b,html body .sd-panel .smart-year-grid .smart-metric>b,
html body .smart-dashboard-metrics .smart-metric>b,html body .report-year .report-card b,html body .resident-summary-card b,
html body .monitor-kpi b,html body .security-stat b,html body .arr-cards>* b,html body .resident-report-cards>* b{font-size:var(--stk-val-fs)!important;}
html body .ssb-mini-sum .mini-tile>span,html body .sd-panel .smart-year-grid .smart-metric>span,html body .smart-dashboard-metrics .smart-metric>span,
html body .resident-summary-card span,html body .monitor-kpi span,html body .security-stat span{font-size:var(--stk-lbl-fs)!important;}
html body .sd-panel .smart-year-grid .smart-metric>small,html body .smart-dashboard-metrics .smart-metric>small,
html body .resident-summary-card small,html body .monitor-kpi small,html body .security-stat small{font-size:var(--stk-note-fs)!important;}
@media (max-width:760px){
  html body #summaryCards .card,html body .ssb-mini-sum .mini-tile,html body .sd-panel .smart-year-grid .smart-metric,html body .report-year .report-card{padding:10px 8px!important;min-height:var(--stk-min-h)!important;}
  html body .sd-panel .smart-year-grid .smart-metric-year:last-child:nth-child(odd){min-height:var(--stk-min-h)!important;}
}
/* update 105 — تثبيت نهائي بأعلى أولوية (يتغلب على قواعد الجوال والأندرويد القديمة) */
html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) #summaryCards .card b,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .ssb-mini-sum .mini-tile b,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .sd-panel .smart-year-grid .smart-metric>b,
html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .report-year .report-card b,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .resident-summary-card b,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .monitor-kpi b,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .security-stat b,
html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .arr-cards>* b,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .resident-report-cards>* b{font-size:var(--stk-val-fs)!important;line-height:1.2!important;font-weight:900!important;}
html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .ssb-mini-sum .mini-tile>span,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .sd-panel .smart-year-grid .smart-metric>span,
html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .resident-summary-card span,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .monitor-kpi span,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .security-stat span{font-size:var(--stk-lbl-fs)!important;line-height:1.4!important;}
html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .sd-panel .smart-year-grid .smart-metric>small,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .resident-summary-card small,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .monitor-kpi small,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .security-stat small{font-size:var(--stk-note-fs)!important;}
html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) #summaryCards .card,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .ssb-mini-sum .mini-tile,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .sd-panel .smart-year-grid .smart-metric,html body :is(#appView,#reportsModal,#residentsMasterModal,.modal) .report-year .report-card{
  min-height:var(--stk-min-h)!important;padding:10px 8px!important;border-radius:12px!important;
  background:var(--stk-bg)!important;border:1px solid var(--stk-bd)!important;border-top:3px solid var(--stk-accent)!important;}

/* ===================================================================
   update 106 — ألوان دالّة لكل ستيكر حسب محتواه + ارتفاع موحد
   =================================================================== */
:root{--stk-min-h:92px;--stk-lbl-fs:12px;--stk-val-fs:18px;--stk-note-fs:10.5px;}
html body .sd-panel .smart-year-grid{grid-auto-rows:auto!important;}
html body #summaryCards .card,html body .ssb-mini-sum .mini-tile,html body .sd-panel .smart-year-grid .smart-metric,html body .report-year .report-card,html body .arr-cards>*,html body .resident-report-cards>*{height:auto!important;min-height:var(--stk-min-h)!important;}
html body #appView .ssb-mini-sum .mini-tile>span,html body .ssb-mini-sum .mini-tile>span{font-size:var(--stk-lbl-fs)!important;}
html body #summaryCards .card b,html body .sd-panel .smart-year-grid .smart-metric>b,html body .report-year .report-card b,html body .resident-summary-card strong,html body .monitor-kpi strong,html body .security-stat strong{font-size:var(--stk-val-fs)!important;}
html body .tone-residents{--stk-accent:#1d4ed8!important;--stk-bg:#eff4ff!important;--stk-label:#1e3a8a!important;--stk-value:#172554!important;--stk-alert:#1d4ed8!important;}
html body .c-rate,html body .tone-rate{--stk-accent:#4338ca!important;--stk-bg:#eef0ff!important;--stk-label:#3730a3!important;--stk-value:#1e1b4b!important;--stk-alert:#4338ca!important;}
html body .c-pay,html body .mini-tile.pay,html body .report-card-pay,html body .tone-pay{--stk-accent:#15803d!important;--stk-bg:#e9f8ef!important;--stk-label:#166534!important;--stk-value:#14532d!important;--stk-alert:#15803d!important;}
html body .c-exp,html body .mini-tile.exp,html body .report-card-exp,html body .tone-exp{--stk-accent:#c2410c!important;--stk-bg:#fff1e8!important;--stk-label:#9a3412!important;--stk-value:#7c2d12!important;--stk-alert:#c2410c!important;}
html body .c-other,html body .report-card-other,html body .tone-other{--stk-accent:#0369a1!important;--stk-bg:#e8f5fc!important;--stk-label:#075985!important;--stk-value:#0c4a6e!important;--stk-alert:#0369a1!important;}
html body .c-total,html body .report-card-income,html body .report-card-total,html body .tone-income{--stk-accent:#a16207!important;--stk-bg:#fbf4dc!important;--stk-label:#854d0e!important;--stk-value:#713f12!important;--stk-alert:#a16207!important;}
html body .c-arr,html body .mini-tile.cnt,html body .report-card-arrears,html body .tone-arr{--stk-accent:#b91c1c!important;--stk-bg:#fdecec!important;--stk-label:#991b1b!important;--stk-value:#991b1b!important;--stk-alert:#b91c1c!important;}
html body .c-bal,html body .mini-tile.bal,html body .report-card-balance,html body .tone-bal{--stk-accent:#0f766e!important;--stk-bg:#e7f6f4!important;--stk-label:#115e59!important;--stk-value:#134e4a!important;--stk-alert:#0f766e!important;}
html body .c-prev,html body .report-card-prev,html body .tone-prev{--stk-accent:#7c3aed!important;--stk-bg:#f3edff!important;--stk-label:#5b21b6!important;--stk-value:#4c1d95!important;--stk-alert:#7c3aed!important;}
html[data-theme="dark"] body .tone-residents{--stk-accent:#60a5fa!important;--stk-bg:#14213d!important;--stk-label:#bfd3ff!important;--stk-value:#ffffff!important;--stk-alert:#60a5fa!important;}
html[data-theme="dark"] body .c-rate,html[data-theme="dark"] body .tone-rate{--stk-accent:#818cf8!important;--stk-bg:#1d1b3d!important;--stk-label:#c7c9ff!important;--stk-value:#ffffff!important;--stk-alert:#818cf8!important;}
html[data-theme="dark"] body .c-pay,html[data-theme="dark"] body .mini-tile.pay,html[data-theme="dark"] body .report-card-pay,html[data-theme="dark"] body .tone-pay{--stk-accent:#4ade80!important;--stk-bg:#0f2a1c!important;--stk-label:#bff0d0!important;--stk-value:#ffffff!important;--stk-alert:#4ade80!important;}
html[data-theme="dark"] body .c-exp,html[data-theme="dark"] body .mini-tile.exp,html[data-theme="dark"] body .report-card-exp,html[data-theme="dark"] body .tone-exp{--stk-accent:#fb923c!important;--stk-bg:#2e1a10!important;--stk-label:#fdc9a6!important;--stk-value:#ffffff!important;--stk-alert:#fb923c!important;}
html[data-theme="dark"] body .c-other,html[data-theme="dark"] body .report-card-other,html[data-theme="dark"] body .tone-other{--stk-accent:#38bdf8!important;--stk-bg:#0c2636!important;--stk-label:#b9e4ff!important;--stk-value:#ffffff!important;--stk-alert:#38bdf8!important;}
html[data-theme="dark"] body .c-total,html[data-theme="dark"] body .report-card-income,html[data-theme="dark"] body .report-card-total,html[data-theme="dark"] body .tone-income{--stk-accent:#facc15!important;--stk-bg:#2c2310!important;--stk-label:#f5dc8a!important;--stk-value:#ffffff!important;--stk-alert:#facc15!important;}
html[data-theme="dark"] body .c-arr,html[data-theme="dark"] body .mini-tile.cnt,html[data-theme="dark"] body .report-card-arrears,html[data-theme="dark"] body .tone-arr{--stk-accent:#f87171!important;--stk-bg:#2d1414!important;--stk-label:#fbb4b4!important;--stk-value:#ffffff!important;--stk-alert:#f87171!important;}
html[data-theme="dark"] body .c-bal,html[data-theme="dark"] body .mini-tile.bal,html[data-theme="dark"] body .report-card-balance,html[data-theme="dark"] body .tone-bal{--stk-accent:#2dd4bf!important;--stk-bg:#0d2a28!important;--stk-label:#aeeee6!important;--stk-value:#ffffff!important;--stk-alert:#2dd4bf!important;}
html[data-theme="dark"] body .c-prev,html[data-theme="dark"] body .report-card-prev,html[data-theme="dark"] body .tone-prev{--stk-accent:#a78bfa!important;--stk-bg:#241838!important;--stk-label:#e0ccff!important;--stk-value:#ffffff!important;--stk-alert:#a78bfa!important;}
@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]) body .tone-residents{--stk-accent:#60a5fa!important;--stk-bg:#14213d!important;--stk-label:#bfd3ff!important;--stk-value:#ffffff!important;--stk-alert:#60a5fa!important;}
:root:not([data-theme="light"]) body .c-rate,:root:not([data-theme="light"]) body .tone-rate{--stk-accent:#818cf8!important;--stk-bg:#1d1b3d!important;--stk-label:#c7c9ff!important;--stk-value:#ffffff!important;--stk-alert:#818cf8!important;}
:root:not([data-theme="light"]) body .c-pay,:root:not([data-theme="light"]) body .mini-tile.pay,:root:not([data-theme="light"]) body .report-card-pay,:root:not([data-theme="light"]) body .tone-pay{--stk-accent:#4ade80!important;--stk-bg:#0f2a1c!important;--stk-label:#bff0d0!important;--stk-value:#ffffff!important;--stk-alert:#4ade80!important;}
:root:not([data-theme="light"]) body .c-exp,:root:not([data-theme="light"]) body .mini-tile.exp,:root:not([data-theme="light"]) body .report-card-exp,:root:not([data-theme="light"]) body .tone-exp{--stk-accent:#fb923c!important;--stk-bg:#2e1a10!important;--stk-label:#fdc9a6!important;--stk-value:#ffffff!important;--stk-alert:#fb923c!important;}
:root:not([data-theme="light"]) body .c-other,:root:not([data-theme="light"]) body .report-card-other,:root:not([data-theme="light"]) body .tone-other{--stk-accent:#38bdf8!important;--stk-bg:#0c2636!important;--stk-label:#b9e4ff!important;--stk-value:#ffffff!important;--stk-alert:#38bdf8!important;}
:root:not([data-theme="light"]) body .c-total,:root:not([data-theme="light"]) body .report-card-income,:root:not([data-theme="light"]) body .report-card-total,:root:not([data-theme="light"]) body .tone-income{--stk-accent:#facc15!important;--stk-bg:#2c2310!important;--stk-label:#f5dc8a!important;--stk-value:#ffffff!important;--stk-alert:#facc15!important;}
:root:not([data-theme="light"]) body .c-arr,:root:not([data-theme="light"]) body .mini-tile.cnt,:root:not([data-theme="light"]) body .report-card-arrears,:root:not([data-theme="light"]) body .tone-arr{--stk-accent:#f87171!important;--stk-bg:#2d1414!important;--stk-label:#fbb4b4!important;--stk-value:#ffffff!important;--stk-alert:#f87171!important;}
:root:not([data-theme="light"]) body .c-bal,:root:not([data-theme="light"]) body .mini-tile.bal,:root:not([data-theme="light"]) body .report-card-balance,:root:not([data-theme="light"]) body .tone-bal{--stk-accent:#2dd4bf!important;--stk-bg:#0d2a28!important;--stk-label:#aeeee6!important;--stk-value:#ffffff!important;--stk-alert:#2dd4bf!important;}
:root:not([data-theme="light"]) body .c-prev,:root:not([data-theme="light"]) body .report-card-prev,:root:not([data-theme="light"]) body .tone-prev{--stk-accent:#a78bfa!important;--stk-bg:#241838!important;--stk-label:#e0ccff!important;--stk-value:#ffffff!important;--stk-alert:#a78bfa!important;}
}

/* ===================================================================
   update 107 — تصغير المحتوى في تطبيق الأندرويد بنحو 8% ليظهر أكثر البيانات
   على كامل عرض الشاشة. الويب لا يتأثر.
   =================================================================== */
html.is-native-app #appView{zoom:.92;}

/* ===================================================================
   update 108 — ترتيب مضغوط لبيانات الساكن ليظهر كل ساكن داخل شاشة الموبايل
   البيانات الأساسية صف واحد، ومدة السكن بتاريخين جنباً إلى جنب، وحالة السكن أصغر
   =================================================================== */
html body #residentsMasterModal .set-res-acc{margin-bottom:8px!important;}
html body #residentsMasterModal .rs-body{padding:8px 10px 10px!important;display:flex!important;flex-direction:column!important;gap:8px!important;}
html body #residentsMasterModal .rs-card{padding:9px 10px!important;border-radius:12px!important;display:flex!important;flex-direction:column!important;gap:7px!important;min-width:0!important;}
html body #residentsMasterModal .rs-card-t{display:flex!important;align-items:center!important;gap:7px!important;margin:0!important;}
html body #residentsMasterModal .rs-card-t i{width:20px!important;height:20px!important;font-size:11px!important;flex:0 0 20px!important;}
html body #residentsMasterModal .rs-card-t span{font-size:13.5px!important;font-weight:900!important;}
html body #residentsMasterModal .rs-grid,html body #residentsMasterModal .rs-g2,html body #residentsMasterModal .rs-g3{display:grid!important;gap:6px!important;margin:0!important;}
html body #residentsMasterModal .rs-g2{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;}
html body #residentsMasterModal .rs-g3{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)!important;}
html body #residentsMasterModal .rs-f{display:flex!important;flex-direction:column!important;gap:3px!important;min-width:0!important;margin:0!important;}
html body #residentsMasterModal .rs-f>span{font-size:11px!important;font-weight:800!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
html body #residentsMasterModal .rs-f input,html body #residentsMasterModal .rs-f select{height:34px!important;min-height:34px!important;font-size:13px!important;padding:0 8px!important;border-radius:9px!important;width:100%!important;}
/* مدة السكن: تاريخان جنباً إلى جنب */
html body #residentsMasterModal .rs-dates{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px!important;}
html body #residentsMasterModal .rs-date{display:flex!important;flex-direction:column!important;gap:3px!important;min-width:0!important;}
html body #residentsMasterModal .rs-date-t{font-size:11px!important;font-weight:800!important;color:#64748b!important;}
html body #residentsMasterModal .rs-date-in{display:grid!important;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr)!important;gap:5px!important;}
html body #residentsMasterModal .rs-date-in input,html body #residentsMasterModal .rs-date-in select{height:34px!important;min-height:34px!important;font-size:12.5px!important;padding:0 6px!important;border-radius:9px!important;width:100%!important;min-width:0!important;}
html body #residentsMasterModal .rs-hint{margin:0!important;font-size:10.5px!important;line-height:1.4!important;}
/* حالة السكن: أصغر */
html body #residentsMasterModal .rs-row2{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;}
html body #residentsMasterModal .rs-check{padding:7px 9px!important;gap:8px!important;}
html body #residentsMasterModal .rs-check-txt b{font-size:12.5px!important;}
html body #residentsMasterModal .rs-check-txt small{font-size:10.5px!important;line-height:1.4!important;}
html body #residentsMasterModal .rs-away{gap:6px!important;}
html body #residentsMasterModal .rs-away-note{font-size:10.5px!important;margin:0!important;}
html body #residentsMasterModal .rs-away-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:4px!important;}
html body #residentsMasterModal .rs-away-grid .rs-m{height:28px!important;min-height:28px!important;font-size:10.5px!important;padding:0 1px!important;border-radius:8px!important;}
/* أزرار الأسفل */
html body #residentsMasterModal .rs-foot{gap:6px!important;padding-top:2px!important;}
html body #residentsMasterModal .rs-btn{height:32px!important;font-size:12px!important;padding:0 10px!important;}
/* الجوال: الحقول الأساسية والتاريخ تبقى جنباً إلى جنب، والشهور أربعة في الصف */
@media (max-width:560px){
  html body #residentsMasterModal .rs-away-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  html body #residentsMasterModal .rs-g3{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)!important;}
}
html[data-theme="dark"] body #residentsMasterModal .rs-date-t{color:#9fb5ad!important;}

/* ===================================================================
   update 110 — مدة السكن بعرض كامل (كل تاريخ في سطر) + إخفاء عبارة
   «الأرقام التراكمية» خارج لوحة المتابعة (تظهر فقط في لوحة المتابعة)
   =================================================================== */
html body #residentsMasterModal .rs-dates{grid-template-columns:minmax(0,1fr)!important;gap:10px!important;}
html body #residentsMasterModal .rs-date-in{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)!important;gap:8px!important;}
html body #residentsMasterModal .rs-date-in select{font-size:13px!important;}
html body:has(.nav-item.active[data-view="payments"]) .cards-scope,
html body:has(.nav-item.active[data-view="expenses"]) .cards-scope,
html body:has(.nav-item.active[data-view="arrears"]) .cards-scope,
html body:has(.nav-item.active[data-view="settings"]) .cards-scope{display:none!important;}

/* ===================================================================
   update 111 — أقسام بيانات الساكن تفتح وتغلق + بحث عن اسم ساكن
   =================================================================== */
html body #residentsMasterModal .rs-collapsible:not(.open) .rs-sec-body{display:none!important;}
html body #residentsMasterModal .rs-sec-tog{width:100%!important;background:none!important;border:0!important;padding:0!important;margin:0!important;display:flex!important;align-items:center!important;gap:7px!important;cursor:pointer;font:inherit!important;color:inherit!important;text-align:right;}
html body #residentsMasterModal .rs-sec-tog span{flex:1 1 auto!important;text-align:right;}
html body #residentsMasterModal .rs-chev{flex:0 0 auto;width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-inline-start:6px;transition:transform .2s ease;opacity:.75;}
html body #residentsMasterModal .rs-collapsible.open .rs-chev{transform:rotate(225deg);}
html body #residentsMasterModal .rs-collapsible:not(.open){padding-bottom:9px!important;}
html body #setResRoot .set-res-search,html body #residentsMasterModal .set-res-search{position:relative;margin:8px 0 10px;}
html body #residentsMasterModal .set-res-search input{width:100%!important;height:40px!important;border-radius:12px!important;border:1px solid #cbd5e1!important;padding:0 14px!important;font-size:14px!important;background:#fff!important;}
html body #residentsMasterModal .set-res-search-n{position:absolute;inset-inline-start:12px;top:50%;transform:translateY(-50%);font-size:11.5px;font-weight:800;color:#0f766e;pointer-events:none;}
html[data-theme="dark"] body #residentsMasterModal .set-res-search input{background:#13211e!important;border-color:#2a3a48!important;color:#f3f1e8!important;}
/* update 112 — إصلاح: بطاقة الساكن تُغلق فعلاً (كانت قاعدة العرض تتغلب على الإغلاق) */
html body #residentsMasterModal .set-res-acc:not(.open)>.rs-body{display:none!important;}
html body #residentsMasterModal .set-res-acc.open>.rs-body{display:flex!important;}
/* update 113 — عدد النتائج تحت خانة البحث، لا فوق النص المكتوب */
html body #residentsMasterModal .set-res-search{display:block!important;position:relative!important;}
html body #residentsMasterModal .set-res-search-n{position:static!important;display:block!important;transform:none!important;margin:5px 4px 0!important;font-size:11.5px!important;font-weight:800!important;color:#0f766e!important;text-align:start!important;}
html body #residentsMasterModal .set-res-search-n:empty{display:none!important;}

/* ===================================================================
   update 115 — جداول التقارير في المعاينة: النص يلتف داخل الخلية ولا يخرج منها
   (الشاشة فقط؛ الطباعة والـPDF لا تتأثر)
   =================================================================== */
@media screen{
  html body #reportRoot .report-payments-table :is(th,td),
  html body #reportRoot .resident-report-summary-table :is(th,td){
    white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;
    overflow:visible!important;line-height:1.3!important;padding:4px 3px!important;
    font-size:10.5px!important;vertical-align:middle!important;text-align:center!important;
  }
  html body #reportRoot .report-payments-table thead th{font-size:9.5px!important;line-height:1.25!important;padding:5px 2px!important;}
  html body #reportRoot .report-payments-table tfoot th{font-size:10px!important;}
  html body #reportRoot .report-payments-table td.rp-name,html body #reportRoot .report-payments-table tbody td:first-child{text-align:start!important;font-size:10.5px!important;}
  html body #reportRoot .report-payments-table td.rp-name{white-space:normal!important;}
}

/* update 116 — نفس القاعدة لكل جداول التقارير في المعاينة (المتأخرات، المصروفات، المدفوعات، تقرير الساكن) */
@media screen{
  html body #reportRoot :is(.rpt-table,.report-expenses-table,.report-payments-table,.resident-report-summary-table) :is(th,td){
    white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;
    overflow:visible!important;line-height:1.3!important;padding:4px 4px!important;vertical-align:middle!important;
  }
  html body #reportRoot :is(.rpt-table,.report-expenses-table) :is(th,td){font-size:11px!important;}
  html body #reportRoot :is(.rpt-table,.report-expenses-table) thead th{font-size:10.5px!important;line-height:1.25!important;}
}
@media screen{
  html body #reportRoot .arr-st{display:inline-block!important;font-size:9.5px!important;line-height:1.2!important;padding:2px 4px!important;white-space:nowrap!important;}
  html body #reportRoot td:has(> .arr-st){min-width:54px!important;}
}
@media screen{
  html body #reportRoot.rv-full :is(.rpt-table,.report-expenses-table,.report-payments-table,.resident-report-summary-table) :is(th,td){white-space:normal!important;word-break:normal!important;overflow-wrap:anywhere!important;}
}

/* update 117 — التفاف النص داخل خلايا كل جداول التقارير في المعاينة والطباعة وملف PDF */
html body :is(#reportRoot,#printHost,.report-root) :is(.rpt-table,.report-expenses-table,.report-payments-table,.resident-report-summary-table) :is(th,td){
  white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;
}
html body :is(#printHost,.report-root) :is(.rpt-table,.report-expenses-table,.report-payments-table) :is(th,td){padding-inline:3px!important;}

/* update 120 — جداول المعاينة (وضع الجداول كما في ملف PDF): لا كسر داخل الكلمات أو الأرقام،
   الأرقام في سطر واحد، والعناوين والأسماء تلتف عند المسافات فقط، والجدول يتمرر أفقيًا داخل التقرير.
   الطباعة وملف PDF لا تتأثر (القاعدة للشاشة فقط). */
@media screen{
  html body #reportRoot.rv-full .rpt-wrap{overflow-x:auto!important;width:100%!important;-webkit-overflow-scrolling:touch;}
  html body #reportRoot.rv-full .rpt-table{width:max-content!important;min-width:100%!important;}
  html body #reportRoot.rv-full .rpt-table th,html body #reportRoot.rv-full .rpt-table td{overflow-wrap:normal!important;word-break:normal!important;}
  html body #reportRoot.rv-full .rpt-table td{white-space:nowrap!important;}
  html body #reportRoot.rv-full .rpt-table th{white-space:normal!important;}
  html body #reportRoot.rv-full .rpt-table th.rpt-year{white-space:nowrap!important;}
  html body #reportRoot.rv-full .rpt-table td.rpt-name,html body #reportRoot.rv-full .rpt-table td.rpt-months{white-space:normal!important;overflow-wrap:break-word!important;}
}

/* ===== تحديث 121: تسمية الأشهر خارج فترة السكن و«لم يسكن» في التقارير ===== */
.rp-outside,.rpt-table .rpt-outside{font-size:11px;line-height:1.25;font-weight:700;background:#f1f5f9;color:#64748b;text-align:center;padding:4px 2px;}
.rp-outside.rp-away,.rpt-table .rpt-outside.rpt-away{background:#fef3c7;color:#92400e;}
html[data-theme="dark"] .rp-outside.rp-away,html[data-theme="dark"] .rpt-table .rpt-outside.rpt-away{background:#3b2f10;color:#fcd34d;}

/* ===== تحديث 126: إضافة ساكن إلى السنة من قائمة منسدلة، وحذف الساكن من السنة من صف الجدول ===== */
.add-resident-select{min-height:42px;max-width:320px;padding:8px 12px;border-radius:12px;border:1px solid #0f3a36;background:#e8f5ef;color:#0f3a36;font:inherit;font-weight:800;cursor:pointer;}
.add-resident-select:disabled{opacity:.55;cursor:not-allowed;}
html[data-theme="dark"] .add-resident-select{background:#12302b;color:#bfe9d7;border-color:#2f6f63;}
.row-action{text-align:center;}
.row-action .delete-resident{min-height:30px;padding:4px 10px;font-size:13px;}

/* ===== تحديث 131: بطاقة «مدفوعات أخرى» في بيانات الساكن ===== */
.rs-oth-row,.rs-oth-add{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:6px 0;}
.rs-oth-row span{min-width:64px;font-weight:800;}
.rs-oth-row input,.rs-oth-add input,.rs-oth-add select{min-height:36px;padding:6px 8px;border-radius:10px;border:1px solid #cbd5d1;font:inherit;min-width:0;flex:1 1 110px;}
