/* Kraken Subsea print templates: Daily Operations Report, Toolbox Talk, Timesheet, crate labels */
.printwrap { background: #CDD3DB; min-height: 100vh; padding-bottom: 40px; }
.print-toolbar { position: sticky; top: 0; z-index: 10; background: var(--navy, #10253F); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.print-toolbar .grow { flex: 1; min-width: 120px; }
.print-toolbar .t { font-weight: 700; font-size: 15px; }
.print-toolbar .s { font-size: 12px; color: #C9D3E0; }
.print-toolbar .btn { min-height: 42px; font-size: 14px; }
.print-toolbar .btn.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.print-toolbar input[type=date] { min-height: 42px; border-radius: 9px; border: 0; padding: 0 8px; font: inherit; }
.print-status { max-width: 210mm; margin: 12px auto 0; padding: 0 8px; }
.paper { background: #fff; width: 210mm; margin: 16px auto; padding: 12mm 10mm; box-shadow: 0 2px 10px rgba(0,0,0,.18); box-sizing: border-box; }
.paper.bleed { padding: 0; }

.ks-doc { font-family: Inter, Arial, sans-serif; font-size: 9.5pt; color: #000; line-height: 1.3; }
.ks-doc + .ks-doc { break-before: page; }
.ks-title { text-align: right; color: #F79623; font-weight: 800; font-size: 20pt; letter-spacing: .01em; margin: 4mm 0 10mm; line-height: 1.1; }
.ks-title2 { color: #10253F; }
.ks-gap { height: 5mm; }
.ks-hdr { display: grid; grid-template-columns: 15% 15% 10% 20% 14% 1fr; border: 1px solid #10253F; }
.ks-hdr .k { background: #10253F; color: #fff; font-weight: 700; padding: 1px 4px; }
.ks-hdr .v { padding: 1px 4px; border-bottom: 0; }
.ks-hdr .span5 { grid-column: span 5; }

.ks-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ks-table td, .ks-table th { border: 1px solid #10253F; padding: 2px 4px; vertical-align: middle; overflow-wrap: anywhere; }
.ks-table .c { text-align: center; }
.ks-headrow > td { border: 0 !important; padding: 0 !important; }
.ks-colhdr th { background: #10253F; color: #fff; font-weight: 700; padding: 6px 4px; text-align: center; }
.ks-colhdr.left th { text-align: left; }
.ks-colhdr.blue th { background: #1F497D; }
.ks-colhdr th.l { text-align: left; }
.ks-dayrow td { font-weight: 700; }
.ks-line td.desc { white-space: pre-wrap; }
.ks-line td.by { color: #4A5B70; font-size: 8.5pt; }
.ks-note td { color: #E07E00; white-space: pre-wrap; }
.ks-daily tr { break-inside: avoid; }
.ks-photos { display: flex; flex-wrap: wrap; gap: 3mm; padding: 2mm 0; }
.ks-photos img { height: 42mm; max-width: 62mm; object-fit: contain; display: block; }
.muted { color: #666; }
.ks-signoff { display: grid; grid-template-columns: 15% 22% 7% 1fr 7% 14%; border: 1px solid #10253F; margin-top: 6mm; break-inside: avoid; }
.ks-signoff .k { background: #10253F; color: #fff; font-weight: 700; padding: 4px; display: flex; align-items: center; }
.ks-signoff .v { padding: 2px 4px; min-height: 13mm; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid #10253F; }
.ks-sig { height: 11mm; max-width: 45mm; object-fit: contain; display: block; }
.ks-stamp { font-size: 7pt; color: #4A5B70; display: block; }
.ks-comment { margin: 3mm 0 0; font-size: 9pt; }

.ks-tbt td { font-size: 8.5pt; }
.ks-box { display: inline-flex; width: 4mm; height: 4mm; border: 1px solid #000; align-items: center; justify-content: center; font-size: 8pt; font-weight: 800; line-height: 1; }
.ks-red { color: #C00000; font-weight: 700; }
.ks-bold { font-weight: 700; }
.ks-comments td { height: 30mm; vertical-align: top; }
.ks-comments .txt { white-space: pre-wrap; margin-top: 2px; }
.ks-att { margin-top: 3mm; }
.ks-att td { height: 10mm; }
.ks-att tr { break-inside: avoid; }

.ks-ts { font-family: Inter, Arial, sans-serif; }
.ks-wave { width: 100%; display: block; }
.ks-ts-body { padding: 0 14mm; }
.ks-ts-title { text-align: center; font-size: 12pt; font-weight: 800; margin: 2mm 0 4mm; }
.ks-ts-hdr { display: grid; grid-template-columns: 25% 25% 25% 25%; border: 1px solid #000; margin-bottom: 5mm; }
.ks-ts-hdr .k { background: #17365D; color: #fff; padding: 1px 4px; border-bottom: 1px solid #000; }
.ks-ts-hdr .v { padding: 1px 4px; border-bottom: 1px solid #000; }
.ks-tstable td, .ks-tstable th, .ks-tstot td, .ks-tstot th, .ks-approvals td, .ks-approvals th { border-color: #000; }
.ks-tstable tr, .ks-approvals tr { break-inside: avoid; }
.ks-tstable td { vertical-align: top; }
.ks-tstot { margin-top: 4mm; }
.ks-approvals { margin-top: 4mm; }
.ks-approvals .ks-colhdr th { background: #17365D; }
.ks-apk { background: #DAEEF3; text-align: left; font-weight: 700; }
.ks-approvals td { height: 12mm; }

.ks-labels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm; }
.ks-label { border: 1.2px solid #10253F; border-radius: 3mm; height: 64mm; padding: 4mm; display: flex; flex-direction: column; gap: 2mm; break-inside: avoid; overflow: hidden; }
.ks-label-top { display: flex; align-items: center; justify-content: space-between; gap: 3mm; font-size: 8pt; font-weight: 700; color: #10253F; border-bottom: 2px solid #F79623; padding-bottom: 2mm; }
.ks-label-top img { height: 8mm; width: auto; }
.ks-label-main { flex: 1; display: flex; gap: 3mm; align-items: center; min-height: 0; }
.ks-label-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.2mm; }
.ks-label-no { font-size: 17pt; font-weight: 800; color: #10253F; line-height: 1.05; overflow-wrap: anywhere; }
.ks-label-desc { font-size: 9.5pt; font-weight: 600; max-height: 12mm; overflow: hidden; }
.ks-label-meta { font-size: 8pt; color: #333; }
.ks-label-scan { font-size: 7.5pt; color: #8A4B00; font-weight: 700; margin-top: 1mm; }
.ks-qr svg { width: 34mm; height: 34mm; display: block; }

@media print {
  html, body { background: #fff !important; }
  .print-toolbar, .print-status, .no-print, #toasts { display: none !important; }
  .printwrap { background: #fff; padding: 0; min-height: 0; }
  .paper { width: auto; max-width: none; margin: 0; padding: 0; box-shadow: none; overflow: visible; zoom: 1 !important; }
  .ks-ts-body { padding: 0 10mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
