/* Printed documents: the receipt / tax invoice, the timetable, the attendance sheet, and every dashboard page sent to the printer.
   Loaded by the dashboard and the website (the receipt is shown on both). One look: navy ink, thin warm lines, the YASFCO logo on top. */
:root { --p-ink: #142439; --p-mute: #5d6672; --p-line: #ddd5c8; --p-soft: #f6f3ee; --p-gold: #b39f6a; }

/* ---------- receipt / tax invoice (screen and paper) ---------- */
.a-doc { background: #fff; color: var(--p-ink); max-width: 820px; margin: 0 auto; padding: 36px 40px; border: 1px solid var(--p-line); line-height: 1.6; }
.a-doc .a-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--p-ink); margin: 0 0 22px; }
.a-doc .a-doc-head img { width: 170px; height: auto; flex: none; }
.a-doc-co { display: grid; gap: 2px; font-size: 13px; color: var(--p-mute); text-align: end; }
.a-doc-co b { font-size: 15px; color: var(--p-ink); }
.a-doc-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.a-doc-title h1 { margin: 0; font-size: 24px; line-height: 1.3; }
.a-doc h2 { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--p-mute); margin: 0 0 8px; font-weight: 700; }
.a-doc dl, .a-meta { margin: 0; }
.a-doc dl > div, .a-meta > div { display: grid; gap: 2px; }
.a-doc dt, .a-meta dt { font-size: 12px; color: var(--p-mute); font-weight: 600; }
.a-doc dd, .a-meta dd { margin: 0; font-weight: 700; color: var(--p-ink); }
.a-doc-ref { display: flex; gap: 28px; }
.a-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; padding: 14px 16px; background: var(--p-soft); border: 1px solid var(--p-line); margin-bottom: 22px; }
.a-lines { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 14px; }
.a-lines th { text-align: start; font-size: 12px; color: var(--p-mute); font-weight: 700; padding: 8px 10px; border-bottom: 1.5px solid var(--p-ink); }
.a-lines td { padding: 12px 10px; border-bottom: 1px solid var(--p-line); vertical-align: top; }
.a-lines td small { display: block; color: var(--p-mute); font-size: 12px; }
.a-lines th:not(:first-child), .a-lines td:not(:first-child) { text-align: end; white-space: nowrap; }
.a-totals { display: grid; gap: 6px; width: min(320px, 100%); margin-inline-start: auto; padding: 14px 16px; border: 1px solid var(--p-line); }
.a-doc .a-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.a-totals > div:first-child { padding-bottom: 8px; border-bottom: 1px solid var(--p-line); font-size: 16px; }
.a-doc-note { margin: 26px 0 0; padding-top: 12px; border-top: 1px solid var(--p-line); font-size: 12px; color: var(--p-mute); text-align: center; }
.num { white-space: nowrap; }
@media screen and (max-width: 760px) {
  .a-doc { padding: 22px 18px; }
  .a-doc .a-doc-head { flex-direction: column; align-items: flex-start; } .a-doc-co { text-align: start; }
  .a-meta { grid-template-columns: 1fr 1fr; }
  .a-lines { font-size: 13px; } .a-lines th, .a-lines td { padding: 8px 6px; }
}

/* ---------- printed timetable and attendance sheet (also readable on screen before printing) ---------- */
.a-printbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.a-printbar label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.a-docsub { margin: -6px 0 18px; color: var(--p-mute); font-weight: 600; }
.a-pweek { margin-bottom: 28px; }
.a-pweek h2 { font-size: 16px; margin: 0 0 10px; }
.a-wgrid { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; }
.a-wgrid th { padding: 8px 6px; font-size: 13px; text-align: start; border: 1px solid var(--p-line); background: var(--p-soft); }
.a-wgrid th small { display: block; font-weight: 500; color: var(--p-mute); font-size: 11px; }
.a-wgrid td { vertical-align: top; padding: 6px; height: 120px; border: 1px solid var(--p-line); }
.a-wgrid .out { background: repeating-linear-gradient(135deg, #fff 0 6px, #f4f1ec 6px 7px); color: #a8aeb6; }
.a-pses { display: grid; gap: 1px; padding: 6px 8px; margin-bottom: 6px; border: 1px solid var(--p-line); border-inline-start: 3px solid var(--p-ink); background: #fff; break-inside: avoid; }
.a-pses b { font-size: 12.5px; line-height: 1.35; }
.a-pses span { font-size: 12px; font-weight: 700; color: var(--p-ink); }
.a-pses small { font-size: 11px; color: var(--p-mute); }
.a-pses.completed { border-inline-start-color: #2f7a4f; }
.a-sheet { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.a-sheet th { padding: 8px 8px; text-align: start; font-size: 12px; border-bottom: 1.5px solid var(--p-ink); background: var(--p-soft); }
.a-sheet td { padding: 9px 8px; border-bottom: 1px solid var(--p-line); }
.a-sheet .mark { text-align: center; width: 56px; }
.a-sheet .sign { width: 120px; }
.a-sheet .code { white-space: nowrap; font-size: 12px; }
.a-sheet .box { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.2px solid var(--p-ink); font-size: 13px; line-height: 1; }
.a-sheet .box.on { background: var(--p-ink); color: #fff; }
.a-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 44px; }
.a-signs div { padding-top: 8px; border-top: 1px solid var(--p-ink); font-size: 13px; font-weight: 600; }
@media screen and (max-width: 760px) { .a-meta { grid-template-columns: 1fr 1fr; } }

/* the print header exists only on paper */
.a-print-head { display: none; }

/* ---------- paper ---------- */
@page { size: A4; margin: 14mm 13mm 16mm;
  @bottom-center { content: counter(page) " / " counter(pages); font: 9pt sans-serif; color: #5d6672; } }
@page wide { size: A4 landscape; margin: 10mm 11mm 13mm;
  @bottom-center { content: counter(page) " / " counter(pages); font: 9pt sans-serif; color: #5d6672; } }

@media print {
  html, body { background: #fff !important; color: var(--p-ink); }
  * { box-shadow: none !important; text-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit !important; text-decoration: none !important; }

  /* nothing to click on paper */
  .no-print, .a-side, .a-bar > div, .a-printbar, .a-calbar, .a-tabs, .a-steps, .a-slot, .a-addday,
  .a-main button, .a-main .a-btn, .a-main input:not([type=hidden]), .a-main select, .a-main textarea, .a-main form label { display: none !important; }

  .a-app { display: block !important; }
  .a-main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .a-app:has(.a-print-wide) { page: wide; }

  /* logo and the centre's details on top of every printed dashboard page (the invoice has its own) */
  .a-print-head { display: flex; align-items: center; gap: 18px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--p-ink); }
  .a-print-head img { width: 40mm; height: auto; flex: none; }
  .a-ph-co { flex: 1; display: grid; gap: 1px; font-size: 9pt; color: var(--p-mute); }
  .a-ph-co b { font-size: 11pt; color: var(--p-ink); }
  .a-ph-date { display: grid; font-size: 8.5pt; color: var(--p-mute); text-align: end; }
  .a-ph-date b { color: var(--p-ink); font-size: 9pt; }
  .a-app:has(.a-doc) .a-print-head { display: none; }

  .a-bar:not(.no-print) { display: block !important; margin: 0 0 4mm !important; padding: 0 !important; border: 0 !important; background: none !important; }
  .a-bar h1 { font-size: 17pt !important; margin: 0 !important; color: var(--p-ink); }
  .a-panel { padding: 0 !important; margin: 0 0 6mm !important; border: 0 !important; background: none !important; }
  .a-panel > h2, h2 { break-after: avoid; }
  .a-stats { gap: 3mm !important; margin-bottom: 5mm !important; }
  .a-stats > div { border: 1px solid var(--p-line) !important; padding: 2.5mm 3.5mm !important; }

  /* tables: headings repeat on each page, a row never splits */
  .a-table { overflow: visible !important; border: 0 !important; }
  table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  thead { display: table-header-group; }
  tr, .a-pses, .a-signs, .a-totals, .a-meta { break-inside: avoid; }
  .a-table th { background: var(--p-soft) !important; color: var(--p-ink) !important; border-bottom: 1.5px solid var(--p-ink) !important; padding: 2mm 2.5mm !important; text-align: start; }
  .a-table td { border-bottom: .5pt solid var(--p-line) !important; padding: 2mm 2.5mm !important; }

  /* invoice on paper: no frame, full width */
  .a-doc { border: 0 !important; padding: 0 !important; max-width: none !important; }

  /* timetable: one week per landscape page */
  .a-pweek { break-before: page; margin: 0; }
  .a-print-wide .a-pweek:first-of-type { break-before: auto; }
  .a-wgrid td { height: auto; min-height: 30mm; }
  .a-wgrid tbody tr { height: 92mm; }
  .a-pses b { font-size: 9.5pt; } .a-pses span { font-size: 9pt; } .a-pses small { font-size: 8.5pt; }

  /* the on-screen calendar, if someone prints the timetable page itself */
  .a-week, .a-cal { break-inside: avoid; }

  /* website pages that show the receipt */
  .hdr, .foot, .page-head, .consent { display: none !important; }
}
.a-meta > .span2 { grid-column: span 2; }
