/* نطاق الإضافة مستقل عن أنماط التطبيق. */
.rr-root {
  --rr-navy: #102f48;
  --rr-dark: #0a2539;
  --rr-gold: #c6a567;
  --rr-ink: #203a4c;
  --rr-muted: #748895;
  --rr-line: #e6ecef;
  direction: rtl;
  color: var(--rr-ink);
  font-family: Cairo, Tahoma, Arial, sans-serif;
  min-width: 0;
}
.rr-root *, .rr-root *::before, .rr-root *::after { box-sizing: border-box; }
.rr-root h2, .rr-root h3, .rr-root p, .rr-root dl, .rr-root dd { margin: 0; }
.rr-root .rr-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.rr-root .rr-month-label { display: flex; flex-direction: column; gap: 5px; color: #5d7482; font-size: 11px; font-weight: 800; }
.rr-root .rr-month { min-height: 42px; min-width: 180px; border: 1px solid #dce6ea; border-radius: 9px; padding: 8px 12px; background: #fff; color: var(--rr-navy); font: inherit; font-size: 13px; }
.rr-root .rr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rr-root .rr-button { min-height: 42px; padding: 9px 18px; border: 1px solid #d7e2e7; border-radius: 9px; background: #fff; color: var(--rr-navy); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.rr-root .rr-button:hover { background: #f4f8f9; border-color: #bacdd5; }
.rr-root .rr-button-primary { background: var(--rr-navy); color: #fff; border-color: var(--rr-navy); }
.rr-root .rr-button-primary:hover { background: #234d67; color: #fff; }
.rr-root .rr-button:disabled { opacity: .6; cursor: wait; }
.rr-root .rr-button:focus-visible, .rr-root .rr-month:focus-visible { outline: 3px solid #c6a567; outline-offset: 2px; }
.rr-root .rr-message { color: #765527; font-size: 12px; line-height: 1.8; }
.rr-root .rr-message:not(:empty) { margin: 0 0 12px; }
.rr-root .rr-document { overflow: hidden; background: #fff; border: 1px solid #e5ecef; border-radius: 14px; box-shadow: 0 6px 24px rgba(16,47,72,.04); }
.rr-root .rr-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 30px; background: #102f48; color: #fff; border-bottom: 4px solid var(--rr-gold); }
.rr-root .rr-eyebrow { display: flex; align-items: center; gap: 8px; color: #d8bf8c; font: 700 9px/1.5 Arial, sans-serif; letter-spacing: 1.1px; direction: ltr; justify-content: flex-end; }
.rr-root .rr-eyebrow span { width: 18px; height: 1px; background: #d8bf8c; }
.rr-root .rr-hero h2 { margin-top: 6px; color: #fff; font-size: 23px; font-weight: 800; line-height: 1.5; }
.rr-root .rr-hero p { margin-top: 3px; color: #bed0da; font-size: 11px; }
.rr-root .rr-hero-period { min-width: 155px; padding: 9px 15px; border-right: 2px solid var(--rr-gold); background: rgba(255,255,255,.07); }
.rr-root .rr-hero-period span, .rr-root .rr-hero-period strong, .rr-root .rr-hero-period small { display: block; }
.rr-root .rr-hero-period span { color: #b8cad3; font-size: 10px; }
.rr-root .rr-hero-period strong { margin: 3px 0; color: #fff; font-size: 15px; }
.rr-root .rr-hero-period small { color: #d5be90; text-align: right; font: 11px/1.5 Arial, sans-serif; }
.rr-root .rr-content { padding: 25px 30px 22px; }
.rr-root .rr-summary-title, .rr-root .rr-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.rr-root .rr-summary-title span { color: #ae945d; font-size: 10px; font-weight: 800; }
.rr-root .rr-summary-title h3 { margin-top: 2px; color: var(--rr-navy); font-size: 15px; font-weight: 800; }
.rr-root .rr-summary-title p, .rr-root .rr-section-heading > p { color: #879aa5; font-size: 10px; line-height: 1.7; }
.rr-root .rr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.rr-root .rr-stat { position: relative; min-width: 0; min-height: 110px; padding: 14px; border: 1px solid var(--rr-line); border-radius: 10px; background: #fbfcfc; overflow: hidden; }
.rr-root .rr-stat::after { content: ''; position: absolute; bottom: 0; right: 0; width: 38%; height: 3px; background: #bda065; }
.rr-root .rr-stat--collected::after { background: #6eab94; }
.rr-root .rr-stat--overdue::after { background: #cc8d7d; }
.rr-root .rr-stat--expense::after { background: #9aaeb7; }
.rr-root .rr-stat-label, .rr-root .rr-stat-note { display: block; color: #7d909a; font-size: 10px; line-height: 1.6; }
.rr-root .rr-stat strong { display: block; margin: 7px 0 4px; color: var(--rr-navy); font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.rr-root .rr-stat--overdue strong { color: #a35f50; }
.rr-root .rr-stat-note { color: #9bacb5; font-size: 9px; }
.rr-root .rr-note { margin-top: 17px; padding: 14px 16px; border: 1px solid #e8e0ce; border-right: 3px solid #c6a567; border-radius: 8px; background: #fcfaf6; color: #627683; font-size: 10px; line-height: 1.9; }
.rr-root .rr-note > strong { color: #78643c; font-size: 11px; }
.rr-root .rr-note p { margin-top: 5px; }
.rr-root .rr-note p strong { color: #29495b; }
.rr-root .rr-note .rr-warning { color: #9b594b; font-weight: 800; }
.rr-root .rr-section { margin-top: 29px; }
.rr-root .rr-section-heading { padding-bottom: 10px; border-bottom: 1px solid var(--rr-line); margin-bottom: 10px; }
.rr-root .rr-section-heading > div { display: flex; align-items: center; gap: 9px; }
.rr-root .rr-section-number { display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 7px; background: #f8f4eb; color: #a98d54; font: 700 10px/1 Arial, sans-serif; }
.rr-root .rr-section h3 { color: var(--rr-navy); font-size: 14px; font-weight: 800; }
.rr-root .rr-entry { border: 1px solid #e9eef0; border-radius: 9px; background: #fff; break-inside: avoid; page-break-inside: avoid; }
.rr-root .rr-entry + .rr-entry { margin-top: 8px; }
.rr-root .rr-contract { padding: 14px 15px 12px; }
.rr-root .rr-entry-head, .rr-root .rr-transaction { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.rr-root .rr-entry-head > div, .rr-root .rr-transaction-main { min-width: 0; }
.rr-root .rr-entry-title, .rr-root .rr-transaction-main strong { color: #234256; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.rr-root .rr-unit-code { margin-right: 4px; color: #9caab2; font: 600 10px/1.6 Arial, sans-serif; }
.rr-root .rr-entry-sub, .rr-root .rr-transaction-main span { display: block; margin-top: 3px; color: #8598a3; font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.rr-root .rr-badge { flex: none; border-radius: 20px; padding: 4px 9px; background: #f2f5f6; color: #798a94; font-size: 9px; font-weight: 800; white-space: nowrap; }
.rr-root .rr-badge--paid { color: #438067; background: #eef8f2; }
.rr-root .rr-badge--late { color: #ab6354; background: #fcf0ed; }
.rr-root .rr-badge--today, .rr-root .rr-badge--upcoming { color: #977d48; background: #fbf6e9; }
.rr-root .rr-contract-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px 0; margin-top: 12px; border-top: 1px solid #edf1f2; border-bottom: 1px solid #edf1f2; }
.rr-root .rr-contract-grid dt { color: #97a7af; font-size: 9px; }
.rr-root .rr-contract-grid dd { margin-top: 4px; color: #304e60; font-size: 11px; font-weight: 800; text-align: right; overflow-wrap: anywhere; }
.rr-root .rr-entry-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding-top: 9px; color: #91a0a8; font-size: 9px; line-height: 1.7; }
.rr-root .rr-reason { margin-top: 6px; color: #a3734a; font-size: 10px; line-height: 1.7; }
.rr-root .rr-transaction { padding: 12px 14px; align-items: center; }
.rr-root .rr-transaction-amount { flex: none; color: #4d9075; font-size: 12px; text-align: left; }
.rr-root .rr-transaction-amount.rr-cost { color: #a76e5f; }
.rr-root .rr-empty { padding: 19px 12px; border: 1px dashed #e2eaed; border-radius: 9px; background: #fafcfc; color: #91a0aa; font-size: 11px; text-align: center; }
.rr-root .rr-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 28px; padding-top: 13px; border-top: 1px solid var(--rr-line); color: #9aaab2; font-size: 9px; }
@media (max-width: 760px) {
  .rr-root .rr-hero { padding: 22px 19px; gap: 14px; }
  .rr-root .rr-hero h2 { font-size: 19px; }
  .rr-root .rr-hero-period { min-width: 115px; padding: 8px 10px; }
  .rr-root .rr-hero-period strong { font-size: 12px; }
  .rr-root .rr-content { padding: 20px 17px; }
  .rr-root .rr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rr-root .rr-stat { min-height: 104px; }
  .rr-root .rr-stat strong { font-size: 16px; }
  .rr-root .rr-contract-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
  .rr-root .rr-toolbar { align-items: stretch; }
  .rr-root .rr-month-label { width: 100%; }
  .rr-root .rr-month { width: 100%; }
  .rr-root .rr-actions { width: 100%; }
  .rr-root .rr-button { flex: 1; }
  .rr-root .rr-hero { flex-direction: column; align-items: stretch; }
  .rr-root .rr-hero-period { display: flex; align-items: center; gap: 10px; }
  .rr-root .rr-hero-period strong { margin: 0; }
  .rr-root .rr-hero-period small { margin-right: auto; }
  .rr-root .rr-summary-title, .rr-root .rr-section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .rr-root .rr-entry-head { flex-wrap: wrap; }
  .rr-root .rr-transaction { align-items: start; }
  .rr-root .rr-transaction-amount { font-size: 11px; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  body * { visibility: hidden; }
  .rr-root, .rr-root * { visibility: visible; }
  .rr-root { position: absolute; inset: 0 auto auto 0; width: 100%; color: #203a4c; }
  .rr-root .rr-no-print { display: none !important; }
  .rr-root .rr-document { overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .rr-root .rr-hero { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .rr-root .rr-content { padding: 18px 0; }
  .rr-root .rr-section-heading { break-after: avoid; page-break-after: avoid; }
  .rr-root .rr-entry, .rr-root .rr-stat { break-inside: avoid; page-break-inside: avoid; }
}
