/* ------------------------------------------------------------------
   print.css - Professional Print Styles
   ------------------------------------------------------------------ */
@media print {

  /* 0 — Hide sections/columns marked for customer only */
  body.print-customer-mode .no-customer-print {
    display: none !important;
  }

  /* 1 — Per-copy visibility: hide internal-only columns & action buttons */
  body.print-customer-mode th.internal-only,
  body.print-customer-mode td.internal-only,
  body.print-customer-mode .actions {
    display: none !important;
  }

  /* Always use landscape so wide tables fit */
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  /* 2 — Page colours & background */
  body {
    background: #fff !important;
    color: #000 !important;
  }

  /* 3 — Strip site chrome */
  header,
  nav,
  .no-print,
  #back-btn,
  .print-btns {
    display: none !important;
  }

  /* 4 — Links */
  .project-link,
  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  /* 5 — Live controls vs print values */
  input:not([readonly]),
  select:not([readonly]),
  textarea:not([readonly]),
  button,
  .form-control,
  .action-btn {
    display: none !important;
  }

  .print-value,
  #remaining-payment,
  #profitDisplay,
  #expensesDisplay,
  .progress-bar,
  .budget-info span,
  .totals-summary span {
    display: inline-block !important;
    white-space: pre-wrap;
    color: #000 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  input[readonly],
  select[readonly],
  textarea[readonly] {
    display: inline-block !important;
    border: none !important;
    background: transparent !important;
    color: #000 !important;
    width: auto !important;
    padding: 0 !important;
  }

  /* 6 — Signature pad */
  #clear-signature,
  #sig-canvas:not(.signed) {
    display: none !important;
  }

  /* 7 — Tables & layout */
  .table-scroll {
    overflow: visible !important;
  }

  .table-scroll table,
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11pt;
  }

  th,
  td {
    border: 1px solid #222 !important;
    padding: 5px 8px !important;
    word-break: break-word;
  }

  tr,
  td,
  th {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* 8 — Remove shadows / padding on <main> */
  main {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* ------------------------------------------------------------------
   On-screen helper colouring
   ------------------------------------------------------------------ */
@media screen {
  body.company .internal-only {
    background: #fff9dd !important;
    color: #c97b00 !important;
    font-style: italic;
  }

  body.print-customer-mode .internal-only {
    background: #fafafa !important;
    color: #eee !important;
  }
}

@media print {
  .no-print {
    display: none !important;
  }
}

