@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800;14..32,900&display=swap');

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; margin: 0; padding: 0 }
html, body, #root { height: 100%; overflow: hidden }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11' 1, 'ss01' 1, 'kern' 1;
  letter-spacing: -0.011em;
}
/* Tabular numbers for financial figures — applied per element where needed */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
/* Refined scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: #D0D5DD; border-radius: 10px }
::-webkit-scrollbar-thumb:hover { background: #98A2B3 }
/* Mobile scrollbar hidden */
@media (max-width: 768px) { ::-webkit-scrollbar { display: none } }
/* Date filter bar: hide scrollbar on all breakpoints */
.date-filter-bar::-webkit-scrollbar { display: none }
/* Input focus glow */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #C9A044 !important;
  box-shadow: 0 0 0 3px rgba(201,160,68,.14) !important;
}
/* Button hover lift */
button:not(:disabled):hover { opacity: 0.88; }
button:not(:disabled):active { transform: scale(0.98); }
/* Spin button visibility */
input[type=number]::-webkit-inner-spin-button { opacity: 1 }
/* Select option */
select option { background: #fff; color: #0C0F1E }
/* Card hover utility */
.card-hover { transition: box-shadow .2s, transform .2s; }
.card-hover:hover { box-shadow: 0 8px 24px rgba(16,24,40,.12), 0 0 0 1px rgba(16,24,40,.06) !important; transform: translateY(-1px); }
/* Smooth transitions for nav */
.nav-item { transition: background .15s, color .15s, border-color .15s; }
@media (max-width: 768px) {
  button, input, select, textarea { font-size: 16px !important }
  button { min-height: 44px }
  * { max-width: 100% }
  body, div, p, span, td, th { word-wrap: break-word; overflow-wrap: break-word }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap }
  input, select, textarea { max-width: 100%; width: 100% }
  html, body { overflow-x: hidden; width: 100% }
}

/* ═══════════════════════════════════════════════════════
   PRINT & REPORT STYLES  — Premium Corporate Layout
   ═══════════════════════════════════════════════════════ */

/* Print document hidden on screen — revealed only inside @media print */
#rpt-print-area { display: none; }

/* Force background colours + gradients to print accurately */
#rpt-print-area,
#rpt-print-area * {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust:          exact !important;
}

/* ── Print page footer: hidden on screen, fixed on every print page */
.rpt-page-footer { display: none; }

@media print {
  /* ── Reset SPA shell so the report flows freely */
  html, body, #root { overflow: visible !important; height: auto !important; }

  /* ── A4 portrait with generous margins; extra bottom for footer */
  @page {
    margin: 12mm 15mm 22mm;
    size: A4 portrait;
  }

  /* ── Page-number via CSS counter (Chrome/Edge) */
  @page { @bottom-right { content: "Page " counter(page) " of " counter(pages); font-size: 8pt; font-family: 'Inter', Arial, sans-serif; color: #9CA3AF; } }
  @page { @bottom-left  { content: "Nasama Properties · Accounting System v2";  font-size: 8pt; font-family: 'Inter', Arial, sans-serif; color: #9CA3AF; } }

  /* ── Visibility isolation: hide the whole app, show only the report */
  body * { visibility: hidden !important; }

  #rpt-print-area {
    display:    block !important;
    visibility: visible !important;
    position:   absolute !important;
    top:   0 !important;
    left:  0 !important;
    width: 100% !important;
    background: #fff !important;
    padding-bottom: 16mm !important; /* clear the footer zone */
  }
  #rpt-print-area * { visibility: visible !important; }

  /* ── Running page footer (fallback, appears via fixed positioning) */
  .rpt-page-footer {
    display:    flex !important;
    visibility: visible !important;
    position:   fixed !important;
    bottom:     0 !important;
    left:   0 !important;
    right:  0 !important;
    padding:    5pt 15mm 4pt !important;
    border-top: 0.75pt solid #E5E7EB !important;
    background: #fff !important;
    font-size:  8pt !important;
    color:      #9CA3AF !important;
    font-family: 'Inter', Arial, sans-serif !important;
    justify-content: space-between !important;
    align-items: center !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust:          exact !important;
  }

  /* ── Utility classes */
  .no-print   { display: none !important; }
  .print-only { display: block !important; }

  /* ── Table page-flow */
  table { border-collapse: collapse !important; page-break-inside: auto; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  tr    { page-break-inside: avoid; }

  /* ── Section and block break control */
  .rpt-section    { page-break-inside: avoid; }
  .rpt-acct-block { page-break-inside: avoid; }
  .page-break     { page-break-before: always !important; }

  /* ── Typography tuning for print */
  #rpt-print-area {
    font-feature-settings: 'tnum' 1, 'kern' 1 !important;
    -webkit-font-smoothing: antialiased !important;
  }

  /* ── Prevent orphaned section headings */
  h2, h3, .rpt-section-label { page-break-after: avoid; }
}
