/* ============================================================
   Print Stylesheet — ذمة PDF Export  (redesigned)
   ============================================================ */

@page {
  size: A4;
  margin: 18mm 20mm 20mm;
}

/* Page numbers via CSS counter */
@page {
  @bottom-center {
    content: "صفحة " counter(page) " من " counter(pages);
    font-size: 7.5pt;
    color: #9ca3af;
    font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
  }
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Hide all app UI */
#app, #modal-overlay, #login-screen,
#name-screen, #tutorial-screen,
#delete-account-modal { display: none !important; }

.sidebar, .bottombar, .topstrip,
.notif-wrap, #signout-btn,
.qactions, .obls-controls,
.obl-actions, .cal-nav, .btn { display: none !important; }

/* Show print container */
#print-report { display: block !important; }

/* ── Base ──────────────────────────────────────────────────── */
body {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', Tahoma, Arial, sans-serif;
  font-size: 9.5pt;
  color: #1a1612;
  background: #fff;
  direction: rtl;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

/* ── Accent bar ────────────────────────────────────────────── */
.print-accent-bar {
  height: 4pt;
  background: linear-gradient(to left, #bf5a3a, #8c3a20);
  margin-bottom: 14pt;
  border-radius: 2pt;
}

/* ── Header ────────────────────────────────────────────────── */
.print-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12pt;
  padding-bottom: 12pt;
  margin-bottom: 18pt;
  border-bottom: 0.75pt solid #e8e2da;
}

.print-header-logo img {
  height: 48pt;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}

.print-header-info {
  text-align: left;
}

.print-report-title {
  font-size: 13pt;
  font-weight: 700;
  color: #1a1612;
  margin-bottom: 4pt;
}

.print-meta {
  font-size: 8.5pt;
  color: #6b7280;
  margin-top: 2pt;
}

.print-meta-user {
  font-size: 8.5pt;
  color: #bf5a3a;
  font-weight: 600;
  margin-top: 3pt;
}

/* ── Summary Grid ──────────────────────────────────────────── */
.print-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8pt;
  margin-bottom: 20pt;
}

.print-summary-item {
  border: 0.75pt solid #e8e2da;
  border-inline-start: 3pt solid #bf5a3a;
  border-radius: 4pt;
  padding: 8pt 10pt;
  background: #fdf8f6;
}

.print-summary-label {
  font-size: 7.5pt;
  color: #6b7280;
  margin-bottom: 4pt;
  letter-spacing: 0.02em;
}

.print-summary-value {
  font-size: 12pt;
  font-weight: 700;
  color: #1a1612;
}

/* ── Section ───────────────────────────────────────────────── */
.print-section {
  margin-bottom: 20pt;
}

.print-section-title {
  font-size: 10pt;
  font-weight: 700;
  color: #bf5a3a;
  border-bottom: 0.75pt solid #e8e2da;
  padding-bottom: 4pt;
  margin-bottom: 8pt;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Tables ────────────────────────────────────────────────── */
.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
}

.print-table th {
  text-align: right;
  background: #f5f0eb;
  border-bottom: 1.5pt solid #d6cdc4;
  border-top: 0.5pt solid #d6cdc4;
  padding: 5pt 7pt;
  font-weight: 700;
  color: #4a3f35;
  letter-spacing: 0.02em;
}

.print-table td {
  text-align: right;
  border-bottom: 0.5pt solid #ede8e3;
  padding: 4.5pt 7pt;
  vertical-align: middle;
  color: #2d2420;
}

.print-table tbody tr:nth-child(even) td {
  background: #faf8f6;
}

.print-table tbody tr:last-child td {
  border-bottom: 1pt solid #d6cdc4;
}

.print-center { text-align: center !important; }

.print-empty {
  text-align: center !important;
  color: #9ca3af;
  padding: 12pt !important;
  font-style: italic;
}

/* ── Status badges ─────────────────────────────────────────── */
.print-badge {
  display: inline-block;
  padding: 1.5pt 5pt;
  border-radius: 3pt;
  font-size: 7.5pt;
  font-weight: 600;
  border: 0.5pt solid transparent;
}

.print-badge-active   { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.print-badge-done     { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.print-badge-inactive { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.print-badge-paid     { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.print-badge-late     { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.print-badge-pending  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.print-badge-neutral  { background: #f9fafb; color: #6b7280; border-color: #e5e7eb; }

/* ── Page break ────────────────────────────────────────────── */
.print-page-break { page-break-before: always; }

.print-table tbody tr { page-break-inside: avoid; }

.print-section { page-break-inside: avoid; }

/* ── Footer ────────────────────────────────────────────────── */
.print-footer {
  margin-top: 20pt;
  border-top: 0.5pt solid #e8e2da;
  padding-top: 6pt;
  font-size: 7.5pt;
  color: #9ca3af;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.print-footer-brand {
  color: #bf5a3a;
  font-weight: 600;
}
