/* Standalone final report print page — layout + print rules aligned with admin.html */

*{margin:0;padding:0;box-sizing:border-box;}
html{overflow-x:hidden;}
/* Paper-white canvas: this page is for print preview; avoid dark theme gray around the report */
html,
body.hrpro-print-final-report{
  background:#fff !important;
  color-scheme:light;
}
body.hrpro-print-final-report.theme-dark,
body.hrpro-print-final-report.theme-light{
  background:#fff !important;
  color:#0f172a;
}
body{
  font-family:var(--font);
  min-height:100vh;
  overflow-x:hidden;
}
/* Light “paper” surfaces even if global theme is dark */
body.hrpro-print-final-report .fr-print-main,
body.hrpro-print-final-report #tab-final-report,
body.hrpro-print-final-report .card,
body.hrpro-print-final-report .final-report-print-area,
body.hrpro-print-final-report .table-wrapper,
body.hrpro-print-final-report .fr-official-print-header{
  background:#fff !important;
  color:#0f172a;
}
body.hrpro-print-final-report .final-report-h1{color:#0f172a;}
body.hrpro-print-final-report .final-report-header-lines,
body.hrpro-print-final-report .final-report-line{color:#334155;}
body.hrpro-print-final-report .final-report-emp-meta{
  background:#f8fafc !important;
  border-color:#e2e8f0 !important;
  color:#334155 !important;
}
body.hrpro-print-final-report .summary-box-screen{
  background:#fff !important;
  border-color:#cbd5e1 !important;
}
body.hrpro-print-final-report .summary-label-screen{color:#64748b !important;}
body.hrpro-print-final-report .summary-value-screen{color:#0f172a !important;}
body.hrpro-print-final-report details.fr-secondary-stats{
  background:#fff !important;
  border-color:#cbd5e1 !important;
}
body.hrpro-print-final-report .report-table-print th{
  background:#f1f5f9 !important;
  color:#0f172a !important;
  border-color:#e2e8f0 !important;
}
body.hrpro-print-final-report .report-table-print td{
  color:#0f172a !important;
  border-color:#e2e8f0 !important;
}
/* Merged date + day column (print page): tighter stack */
body.hrpro-print-final-report .fr-print-date-day-cell{
  line-height:1.35;
  min-width:72px;
  max-width:104px;
}
body.hrpro-print-final-report .table-wrapper{
  border-color:#e2e8f0 !important;
}
/* A4-width preview on screen (optional fit) */
body.hrpro-print-final-report .fr-print-main{
  max-width:210mm;
  margin-left:auto;
  margin-right:auto;
  padding-left:12px;
  padding-right:12px;
  padding-bottom:28px;
}

.fr-print-toolbar{
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  padding:14px 18px;border-bottom:1px solid #e2e8f0;
  background:#f8fafc;box-shadow:0 1px 0 rgba(0,0,0,0.06);
  color:#0f172a;
}
body.hrpro-print-final-report .fr-print-toolbar-title{color:#0f172a;}
.fr-print-toolbar-title{font-size:15px;font-weight:700;}
.fr-print-toolbar-actions{display:flex;gap:10px;flex-wrap:wrap;}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 22px;border-radius:10px;border:none;font-family:var(--font);font-size:14px;font-weight:600;cursor:pointer;transition:all .2s;}
.btn-primary{background:var(--accent);color:#000;}
.btn-primary:hover{background:var(--accent2);}
.btn-ghost{background:transparent !important;color:var(--accent) !important;border:1px solid var(--border) !important;}
.btn-ghost:hover{background:var(--accentG) !important;}
.fr-print-error{
  margin:12px 18px;padding:12px 16px;border-radius:12px;
  border:1px solid var(--danger);background:rgba(239,68,68,0.08);color:var(--danger);
  font-size:14px;
}
/* .fr-print-main: max-width set above for paper preview; padding horizontal for small screens */

/* Match admin: show official header/footer in "print mode" on screen */
#tab-final-report .fr-official-print-header{display:block !important;}
#tab-final-report .fr-print-footer-final{display:block !important;}
#tab-final-report .fr-print-only-subthead{display:table-row !important;}
#tab-final-report .fr-print-day-deduct-inline{
  display:block !important;margin-top:5px;padding-top:4px;border-top:1px dashed #bbb;
  font-size:9pt;line-height:1.35;font-weight:500;color:#111;text-align:start;
  -webkit-print-color-adjust:exact;print-color-adjust:exact;
}
#tab-final-report.fr-density-compact .final-report-table th.fr-col-detail,
#tab-final-report.fr-density-compact .final-report-table td.fr-col-detail{
  display:table-cell !important;
}
#tab-final-report.fr-density-compact .fr-sug-wrap{display:none !important;}

.card.print-area.final-report-print-area{overflow:visible;}
.final-report-print-area{direction:inherit;padding:0 0 16px;max-width:100%;}
.final-report-print-header{margin-bottom:24px;}
.final-report-header-top{
  display:flex;justify-content:flex-start;border-bottom:2px solid var(--border);
  padding:12px 12px 16px;box-sizing:border-box;
}
.final-report-header-text{text-align:start;max-width:100%;min-width:0;}
html[dir="rtl"] .final-report-header-text{text-align:right;}
.final-report-h1{
  margin:0;font-size:clamp(18px,4.5vw,24px);font-weight:800;color:var(--text);
  line-height:1.2;word-break:break-word;
}
.final-report-header-lines{margin-top:12px;font-size:14px;color:var(--textM);line-height:1.75;}
.final-report-line{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;}
.final-report-period{
  direction:ltr;unicode-bidi:embed;color:var(--accent);
  font-family:var(--mono);font-size:13px;word-break:break-all;
}
.final-report-emp-meta{
  margin-top:14px;padding:12px 14px;background:var(--surface2);
  border-radius:var(--r-md);border:1px solid var(--border2);
  font-size:13px;color:var(--textM);line-height:1.65;
  display:grid;grid-template-columns:repeat(auto-fill,minmax(min(200px,100%),1fr));
  gap:10px 14px;box-sizing:border-box;
}
.final-report-summary-row{
  display:flex;gap:12px;margin-top:14px;flex-wrap:wrap;padding:0 12px;box-sizing:border-box;
}
.final-report-summary-row--secondary{margin-top:12px;}
.summary-box-screen{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  padding:16px;text-align:center;flex:1;
}
.summary-label-screen{
  font-size:11px;color:var(--textM);text-transform:uppercase;letter-spacing:1px;margin-bottom:6px;
}
.summary-value-screen{font-size:24px;font-weight:700;font-family:var(--mono);}
.badge{display:inline-flex;align-items:center;padding:3px 9px;border-radius:20px;font-size:11px;font-weight:600;font-family:var(--mono);}
.badge-ok{background:rgba(16,185,129,0.1);color:var(--success);border:1px solid rgba(16,185,129,0.2);}
.badge-pending{background:rgba(245,158,11,0.1);color:var(--warning);border:1px solid rgba(245,158,11,0.2);}
.badge-rejected{background:rgba(239,68,68,0.1);color:var(--danger);border:1px solid rgba(239,68,68,0.2);}

.final-report-table-wrap{max-width:100%;box-sizing:border-box;}
/* Avoid clipping the outer table stroke (esp. RTL “left” edge in print preview) */
body.hrpro-print-final-report .table-wrapper.final-report-table-wrap{
  overflow-x:visible !important;
  overflow:visible !important;
}
.table-wrapper{width:100%;overflow-x:auto;border-radius:14px;background:var(--surface);border:1px solid var(--border);}

.report-table-print th{
  background:var(--surface3);color:var(--accent);padding:14px 12px;font-size:13px;font-weight:600;
  text-align:center;border-bottom:1px solid var(--border);
}
.report-table-print td{
  padding:14px 12px;font-size:13.5px;color:var(--text);text-align:center;
  border-bottom:1px solid var(--border2);font-family:var(--mono);
}
.report-table-print tr:last-child td{border-bottom:none;}

body.hrpro-print-final-report #tab-final-report{
  display:block !important;position:relative;visibility:visible;overflow:visible;
}

@media print{
  /* A4: ~210×297mm; safe margins for most office printers (content area ~186×257 @ 12mm V / 10mm H) */
  @page{
    size:A4 portrait;
    margin:12mm 10mm 14mm 10mm;
  }
  html{
    background:#fff !important;
  }
  body{
    background:#fff !important;
    color:#000 !important;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  body *{visibility:hidden;}
  .print-area,.print-area *{visibility:visible;}
  .print-area{
    position:static !important;width:100% !important;max-width:100% !important;
    margin:0 !important;padding:0 !important;
    display:block !important;background:#fff !important;color:#000 !important;
  }
  .fr-no-print{display:none !important;}
  .main{margin:0 !important;padding:0 !important;}
  body.hrpro-print-final-report .fr-print-main{
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
  }
  table.hrpro-responsive-table.report-table-print{
    display:table !important;min-width:100% !important;width:100% !important;
    max-width:100% !important;
    border-collapse:collapse !important;margin-top:15px !important;table-layout:fixed !important;
    border:1px solid #000 !important;background:#fff !important;
  }
  thead{display:table-header-group !important;}
  tbody{display:table-row-group !important;}
  tr{display:table-row !important;}
  th,td{
    display:table-cell !important;border:1px solid #000 !important;padding:6px 4px !important;
    text-align:center !important;font-size:8.5pt !important;word-wrap:break-word;
    color:#000 !important;background:#fff !important;
  }
  td::before{content:none !important;}
  th{background:#eeeeee !important;font-weight:bold !important;-webkit-print-color-adjust:exact;}
  .badge{border:none !important;background:transparent !important;color:#000 !important;padding:0 !important;font-weight:bold;font-size:8pt;}

  body.hrpro-print-final-report #tab-final-report .print-area,
  body.hrpro-print-final-report #tab-final-report .print-area *{
    visibility:visible !important;color:#000 !important;opacity:1 !important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
  .print-area .final-report-print-header,.print-area .final-report-print-header *{color:#000 !important;}
  .print-area .final-report-h1{font-size:16pt !important;color:#000 !important;}
  .print-area .final-report-header-lines,.print-area .final-report-line,.print-area .final-report-period{color:#111 !important;}
  .print-area .final-report-emp-meta{
    display:block !important;margin-top:10px !important;padding:10px 12px !important;
    background:#f4f4f4 !important;border:1px solid #333 !important;border-radius:6px !important;
    font-size:9.5pt !important;line-height:1.45 !important;color:#000 !important;
    grid-template-columns:none !important;
  }
  .print-area .final-report-summary-row{display:flex !important;flex-wrap:wrap !important;gap:8px !important;}
  .summary-box-screen{border:1px solid #ccc !important;background:transparent !important;color:#000 !important;border-radius:6px !important;}
  .summary-label-screen{color:#666 !important;}
  .summary-value-screen{color:#000 !important;}

  body.hrpro-print-final-report table.final-report-table.report-table-print th,
  body.hrpro-print-final-report table.final-report-table.report-table-print td{
    font-size:11.5pt !important;padding:10px 8px !important;line-height:1.35 !important;
  }
  body.hrpro-print-final-report table.final-report-table.report-table-print td.fr-print-date-day-cell{
    font-size:10pt !important;padding:8px 6px !important;line-height:1.3 !important;
  }
  body.hrpro-print-final-report table.final-report-table.report-table-print th{font-size:11pt !important;background:#e8e8e8 !important;}
  body.hrpro-print-final-report .print-area .final-report-h1{font-size:22pt !important;font-weight:800 !important;}
  body.hrpro-print-final-report .fr-print-footer-final{font-size:11pt !important;color:#000 !important;}
  body.hrpro-print-final-report .fr-print-legal-p{font-size:11pt !important;}

  body.fr-print-no-settlement table.hrpro-responsive-table.final-report-table.report-table-print{
    table-layout:auto !important;
  }

  body.hrpro-print-final-report #tab-final-report .final-report-table-wrap{
    border:2px solid #000 !important;box-sizing:border-box;margin:10px 0 0 !important;
    overflow:visible !important;overflow-x:visible !important;
    background:#fff !important;
  }
  body.hrpro-print-final-report #tab-final-report table.final-report-table.report-table-print{
    display:table !important;width:100% !important;border:2px solid #000 !important;
    border-collapse:collapse !important;margin:0 !important;background:#fff !important;
    font-family:'Times New Roman',Times,'IBM Plex Sans Arabic','Segoe UI',serif !important;
  }
  body.hrpro-print-final-report #tab-final-report .hrpro-responsive-table.final-report-table th,
  body.hrpro-print-final-report #tab-final-report .hrpro-responsive-table.final-report-table td{
    display:table-cell !important;border:1px solid #000 !important;vertical-align:top !important;
  }
  /* RTL/LTR: outer vertical rule sometimes drops with collapse — reinforce logical outer edges */
  body.hrpro-print-final-report #tab-final-report table.final-report-table.report-table-print thead tr th:first-child,
  body.hrpro-print-final-report #tab-final-report table.final-report-table.report-table-print tbody tr td:first-child{
    border-inline-start:2px solid #000 !important;
  }
  body.hrpro-print-final-report #tab-final-report table.final-report-table.report-table-print thead tr th:last-child,
  body.hrpro-print-final-report #tab-final-report table.final-report-table.report-table-print tbody tr td:last-child{
    border-inline-end:2px solid #000 !important;
  }
  body.hrpro-print-final-report #tab-final-report .hrpro-responsive-table.final-report-table td::before{
    content:none !important;display:none !important;
  }
  /* Summary strip: white paper, dark text (saves ink vs dark panels) */
  body.hrpro-print-final-report .summary-box-screen,
  body.hrpro-print-final-report details.fr-secondary-stats{
    background:#fff !important;
    border-color:#ccc !important;
    color:#000 !important;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  body.hrpro-print-final-report .summary-label-screen{color:#333 !important;}
  body.hrpro-print-final-report .summary-value-screen{color:#000 !important;}
}
