/* V3 print: screen styles for this work package only. Built on css/odoo.css classes (see its header and docs/V3_A_REPORT.md); no new colours or sizes outside the Odoo tokens. */

/* =====================================================================
   WP-F2  PRINT / DAILY REPORT  (rPrint in index.html)
   Screen: Odoo control panel (.o_control_panel.pr-cp: title, the day as a select facet,
   pager, primary button) over a white A4-width sheet (.pr-doc > .pr-paper).
   Paper: .pr-head, then the sections as .card.pr-sec. Sections 1-7 are the
   sheet's PRINT_REPORT sections and take its colours as Odoo tag tints
   (the card-h carries o_tag_color_N from css/odoo.css: 2 orange, 5 purple, 7 teal,
   8 blue = the sheet's navy, 3 yellow = its gold); our extra sections 8-15
   have the neutral grey band (.pr-x). Lists: .pr-paper table, TOTAL / TEAM
   rows are .pr-tot (the list footer). Charts: .pr-figs > .pr-fig (pure SVG
   from js/charts.js; every colour is an attribute, so paper keeps them).
   ===================================================================== */

/* page footer "Page X of Y" (Chrome 131+ margin boxes; ignored elsewhere). #495057 = --odoo-gray-700: custom properties do not reach the margin boxes. */
@page { @bottom-center { content: "Page " counter(page) " of " counter(pages); font-size: 9px; color: #495057; } }

/* ---- control panel ---- */
.pr-cp { margin: -8px -16px 0; }
.pr-cp .cp-title h1 { font-size: var(--odoo-fs-base); font-weight: 400; }
.pr-day .o_searchview_facet { height: auto; min-height: 22.3px; }
.pr-day select { width: auto; min-height: 0; height: 22px; padding: 0 4px; border: 0; background: transparent; box-shadow: none; font-size: var(--odoo-fs-base); cursor: pointer; }
.pr-day select:focus { box-shadow: none; outline: 0; }
.pr-day .o_searchview_facet_label { cursor: pointer; }
.pr-cp .o_pager .o_pager_btn:disabled { opacity: .5; cursor: default; }
@media (min-width: 992px) {
  .pr-day { flex: 0 0 auto; width: auto; padding-right: 8px; }
}

/* ---- the sheet ---- */
.pr-doc { padding: 0 0 16px; }
.pr-paper { box-sizing: border-box; width: 100%; max-width: 210mm; margin: 0 auto; padding: 10mm; background: var(--odoo-light);
  border: 1px solid var(--odoo-gray-300); border-radius: var(--odoo-radius-lg); font-size: 12px; line-height: 1.4; color: var(--odoo-body-color); }
@media (max-width: 767.98px) { .pr-paper { padding: 16px 12px; } }
.pr-head { text-align: center; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2px solid var(--odoo-primary); }
.pr-title { font-size: var(--odoo-fs-h2); line-height: 1.3; font-weight: 700; color: var(--odoo-heading-color); }
.pr-sub { font-size: var(--odoo-fs-h5); font-weight: 500; color: var(--odoo-primary); }
.pr-meta { margin-top: 2px; font-size: 11px; color: var(--odoo-tertiary-color); }
.pr-none { margin: 0 0 12px; text-align: center; color: var(--odoo-secondary-color); }

/* section bar = the card header: tint + dark text + 4px mid-shade edge (colours: o_tag_color_N) */
.pr-paper .card { margin-bottom: 12px; border-radius: var(--odoo-radius); }
.pr-paper .card-h { padding: 6px 12px; font-size: 13px; line-height: 18px; font-weight: 700;
  border-left-width: 4px; border-left-style: solid; }
.pr-paper .card-h[class*="o_tag_color_"] { background: var(--_bg); color: var(--_tx); border-left-color: var(--_bd); }
.pr-paper .card-h.pr-x { background: var(--odoo-gray-200); color: var(--odoo-gray-700); border-left-color: var(--odoo-gray-500); }
.pr-paper .card-b { padding: 8px 12px; }

/* lists */
.pr-paper table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.35; }
.pr-paper th, .pr-paper td { border: 0; }
.pr-paper thead th { height: auto; padding: 5px 6px; font-size: 11px; font-weight: 500; color: var(--odoo-gray-700);
  background: var(--odoo-gray-100); border-bottom: 1px solid var(--odoo-gray-300); }
.pr-paper tbody td { height: auto; padding: 4px 6px; font-size: 12px; border-bottom: .67px solid var(--odoo-gray-300); }
.pr-paper thead th:first-child, .pr-paper tbody td:first-child { padding-left: 8px; }
.pr-paper thead th:last-child, .pr-paper tbody td:last-child { padding-right: 8px; }
.pr-paper th.num, .pr-paper td.num { text-align: right; }
.pr-paper tbody tr:hover { background: transparent; }
.pr-paper tbody tr.pr-tot td { font-weight: 500; color: var(--odoo-heading-color); background: var(--odoo-gray-100); border-top: 1px solid var(--odoo-gray-400); }
@media (min-width: 640px) { .pr-paper .g2 { grid-template-columns: 1fr 1fr; } }
.pr-paper .kpi-grid { margin-bottom: 0; gap: 8px; }
.pr-paper .kpi { min-height: 0; padding: 8px 12px; }
.pr-paper .kpi-val { font-size: var(--odoo-fs-h2); line-height: 1.2; }

/* charts */
.pr-figs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 10px; }
.pr-fig { flex: 0 1 320px; min-width: 0; margin: 0; }
.pr-fig-w { flex-basis: 680px; max-width: 100%; }
.pr-fig figcaption { margin: 0 0 2px; font-size: 11px; font-weight: 500; text-align: center; color: var(--odoo-gray-700); }

/* ---- on paper: no sheet frame, the page margin (10mm) is the sheet's ---- */
@media print {
  .pr-doc { padding: 0; }
  .pr-paper { max-width: none; padding: 0; border: 0; border-radius: 0; background: none; font-size: 11px; }
  .pr-head { padding-bottom: 6px; margin-bottom: 8px; }
  .pr-title { font-size: 18px; }
  .pr-sub { font-size: 13px; }
  .pr-meta { font-size: 9px; }
  .pr-paper.pr-month .card { break-inside: auto; page-break-inside: auto; }   /* the Month report's long tables may run over a page */
  .pr-paper.pr-month .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pr-paper .card { break-inside: avoid; page-break-inside: avoid; margin-bottom: 8px; border: 1px solid var(--odoo-gray-300); border-radius: 4px; overflow: visible; }
  .pr-paper .card-h { padding: 4px 10px; font-size: 11px; line-height: 15px; break-after: avoid; page-break-after: avoid; }
  .pr-paper .card-h.pr-x { background: var(--odoo-gray-200); }
  .pr-paper .card-b { padding: 6px 10px; overflow: visible; }
  .pr-paper table { font-size: 10px; }
  .pr-paper thead { display: table-header-group; }
  .pr-paper thead th { padding: 3px 6px; font-size: 9.5px; color: var(--odoo-gray-700); background: var(--odoo-gray-100); border-bottom: 1px solid var(--odoo-gray-400); }
  .pr-paper tbody td { padding: 3px 6px; font-size: 10px; }
  .pr-paper tr { break-inside: avoid; page-break-inside: avoid; }
  .pr-paper .kpi-val { font-size: var(--odoo-fs-h5); }
  .pr-paper .kpi { border: 1px solid var(--odoo-gray-300); }
  .pr-figs { margin-top: 6px; gap: 2px 10px; break-inside: avoid; page-break-inside: avoid; }
  .pr-fig { flex-basis: 280px; }
  .pr-fig-w { flex-basis: 640px; }
  .pr-fig figcaption { font-size: 9px; }
}
/* the first header cell keeps the same head grey as the rest (index.html's print block greys it) */
.pr-paper .card-b > table thead th:first-child, .pr-paper .card-b > table.tn thead th:nth-child(2) { background: var(--odoo-gray-100); }
