/* DPR & SVR — SubletWorks report forms (print-ready) */
.report-page {
  background: #e8ecf1;
  padding: var(--space-lg) 0 var(--space-3xl);
  min-height: 100vh;
}

.report-toolbar {
  max-width: 1100px;
  margin: 0 auto var(--space-lg);
  padding: 0 var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
}

.report-toolbar__left,
.report-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.report-toolbar__title {
  font-size: 0.95rem;
  color: var(--color-navy, #0f172a);
  margin-left: 8px;
}

/* Share menu */
.report-share-wrap {
  position: relative;
}

.report-share-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-share-menu[hidden] {
  display: none !important;
}

.report-share-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-navy, #0f172a);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.report-share-menu button:hover {
  background: var(--color-bg-alt, #f1f5f9);
  color: var(--color-orange, #f37021);
}

@media print {
  .report-share-wrap,
  .report-share-menu {
    display: none !important;
  }
}

.report-sheet {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 4px 24px rgba(1, 22, 39, 0.12);
  font-size: 11px;
  line-height: 1.35;
  color: #1a1a1a;
  box-sizing: border-box;
}

.report-sheet--dpr { --report-accent: #002060; --report-bar: #ffc000; }
.report-sheet--svr { --report-accent: #004d40; --report-bar: #e8f5e9; }

/* Header */
.report-header {
  display: grid;
  grid-template-columns: 140px 1fr 200px;
  gap: 0;
  border-bottom: 3px solid var(--report-accent);
}

.report-header__brand {
  padding: 12px;
  border-right: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-logo-box {
  width: 100%;
  height: 52px;
  border: 1px dashed #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #666;
  text-transform: uppercase;
  cursor: pointer;
}

.report-logo-upload {
  display: block;
  cursor: pointer;
}

.report-logo-img {
  width: 100%;
  max-height: 52px;
  object-fit: contain;
  display: block;
}

.report-brand-input {
  border: none;
  border-bottom: 1px solid #ccc;
  font-size: 10px;
  padding: 2px 0;
  width: 100%;
  background: transparent;
  font-family: inherit;
}

.report-brand-tagline {
  font-size: 9px;
}

.report-meta-row--checks {
  grid-template-columns: 72px 1fr;
}

.report-meta-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 9px;
}

.report-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.report-fields--1 {
  grid-template-columns: 1fr;
}

.report-letter-block textarea {
  width: 100%;
  border: none;
  padding: 12px;
  font-size: 10px;
  line-height: 1.6;
  font-family: inherit;
  min-height: 140px;
  resize: vertical;
}

.report-ppe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.report-ppe-item {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 6px 10px;
  border-bottom: 1px solid #dde2e8;
  border-right: 1px solid #dde2e8;
  font-size: 9px;
  font-weight: 600;
  align-items: center;
}

.report-ppe-item label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.report-checks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding: 10px 12px;
}

.report-checks-grid__item {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
}

.report-declaration-text {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 600;
  margin: 0;
  border-bottom: 1px solid #dde2e8;
}

.report-table td.col-check {
  text-align: center;
  vertical-align: middle;
}

.report-table td.col-check input {
  width: auto;
  min-height: auto;
  margin: 0 auto;
  display: block;
}

.report-signatures--single {
  grid-template-columns: 1fr;
  max-width: 360px;
  margin-left: auto;
  margin-right: 12px;
}

/* HTP Poster */
.report-poster__hero {
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  color: #fff;
  text-align: center;
  padding: 28px 16px;
}

.report-poster__icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.report-poster__title {
  font-size: 26px;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.04em;
}

.report-poster__subtitle {
  margin: 8px 0 0;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.report-poster__section h2 {
  background: #0d47a1;
  color: #fff;
  font-size: 11px;
  margin: 0;
  padding: 6px 10px;
  text-transform: uppercase;
}

.report-poster__ppe {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 12px;
}

.report-poster__ppe-item {
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  border: 1px solid #c5cdd8;
  padding: 8px 4px;
  border-radius: 4px;
}

.report-poster__ppe-ic {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}

.report-poster__steps,
.report-poster__warn {
  margin: 0;
  padding: 12px 12px 12px 28px;
  font-size: 10px;
  line-height: 1.5;
}

.report-poster__warn--emergency li {
  font-weight: 700;
  color: #b71c1c;
}

.report-poster__remember {
  text-align: center;
  font-weight: 900;
  font-size: 12px;
  padding: 16px;
  background: #fff3cd;
  border-top: 2px solid #0d47a1;
  border-bottom: 2px solid #0d47a1;
}

.report-poster__approval {
  padding: 0 0 12px;
}

.report-poster__approval h2 {
  background: #0d47a1;
  color: #fff;
  font-size: 11px;
  margin: 0;
  padding: 6px 10px;
}

.report-header__title-wrap {
  background: var(--report-accent);
  color: #fff;
  padding: 14px 16px;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 98% 100%, 0 100%);
}

.report-header__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0;
  text-transform: uppercase;
}

.report-header__tagline {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: var(--report-bar);
  color: #000;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.report-sheet--svr .report-header__tagline {
  background: #fff;
  color: var(--report-accent);
}

.report-header__meta {
  padding: 10px 12px;
  border-left: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-meta-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 4px;
}

.report-meta-row label {
  font-weight: 700;
  font-size: 9px;
  color: var(--report-accent);
}

.report-meta-row input,
.report-meta-row select {
  border: none;
  border-bottom: 1px solid #333;
  padding: 2px 4px;
  font-size: 10px;
  background: transparent;
  width: 100%;
}

/* Sections */
.report-body {
  padding: 10px 12px 16px;
}

.report-section {
  margin-bottom: 10px;
  border: 1px solid #b0b8c4;
}

.report-section__head {
  background: var(--report-accent);
  color: #fff;
  padding: 5px 10px;
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-section__head--sub {
  background: #3d5a80;
  font-size: 9px;
}

.report-sheet--svr .report-section__head--sub {
  background: #00695c;
}

.report-fields {
  display: grid;
  gap: 0;
}

.report-fields--2 { grid-template-columns: 1fr 1fr; }
.report-fields--3 { grid-template-columns: 1fr 1fr 1fr; }
.report-fields--6 { grid-template-columns: repeat(3, 1fr); }

.report-field {
  display: grid;
  grid-template-columns: 110px 1fr;
  border-bottom: 1px solid #dde2e8;
  border-right: 1px solid #dde2e8;
  min-height: 26px;
}

.report-field:last-child { border-right: none; }

.report-field label {
  padding: 4px 8px;
  font-weight: 600;
  font-size: 9px;
  background: #f4f6f8;
  border-right: 1px solid #dde2e8;
  display: flex;
  align-items: center;
}

.report-field input,
.report-field textarea,
.report-field select {
  border: none;
  padding: 4px 8px;
  font-size: 10px;
  width: 100%;
  font-family: inherit;
  background: #fff;
}

.report-field textarea {
  resize: vertical;
  min-height: 48px;
}

.report-field--full {
  grid-column: 1 / -1;
  grid-template-columns: 140px 1fr;
}

/* Weather */
.report-weather {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 12px;
  align-items: center;
  border-bottom: 1px solid #dde2e8;
}

.report-weather label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
}

.report-weather input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

/* Tables */
.report-table-wrap {
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  table-layout: fixed;
}

.report-table th {
  background: var(--report-accent);
  color: #fff;
  padding: 5px 4px;
  text-align: left;
  font-weight: 700;
  border: 1px solid #fff;
}

.report-table td {
  border: 1px solid #c5cdd8;
  padding: 0;
  vertical-align: top;
}

.report-table td input,
.report-table td textarea {
  width: 100%;
  border: none;
  padding: 4px 5px;
  font-size: 9px;
  min-height: 22px;
  background: transparent;
  font-family: inherit;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.report-table td textarea {
  min-height: 36px;
}

.report-table .col-sno {
  width: 28px;
  text-align: center;
  background: #f4f6f8;
  font-weight: 700;
  padding: 4px 2px;
}

.report-table .col-narrow { width: 48px; }
.report-table .col-unit { width: 40px; }

.report-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.report-cols .report-section { margin-bottom: 0; }

/* Photos SVR */
.report-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
}

.report-photo-slot {
  aspect-ratio: 4/3;
  border: 2px dashed #90a4ae;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #607d8b;
  background: #fafbfc;
}

.report-photo-slot input[type="file"] {
  font-size: 8px;
  max-width: 100%;
}

/* Purpose checkboxes */
.report-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 8px 12px;
}

.report-checklist label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
}

/* Signatures */
.report-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 2px solid var(--report-accent);
  margin-top: 12px;
}

.report-sign-box {
  border-right: 1px solid #ccc;
  padding: 10px 12px;
  text-align: center;
}

.report-sign-box:last-child { border-right: none; }

.report-sign-box h4 {
  font-size: 9px;
  font-weight: 800;
  color: var(--report-accent);
  margin: 0 0 12px;
  text-transform: uppercase;
}

.report-sign-line {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 4px;
  margin-bottom: 8px;
  text-align: left;
}

.report-sign-line span {
  font-size: 8px;
  font-weight: 700;
}

.report-sign-line input {
  border: none;
  border-bottom: 1px solid #333;
  font-size: 9px;
  padding: 2px;
}

/* Footer bar */
.report-footer-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--report-accent);
  color: #fff;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 8px 4px;
}

.report-footer-bar span::before {
  content: '● ';
  color: var(--report-bar);
}

.report-sheet--svr .report-footer-bar {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 900px) {
  .report-header {
    grid-template-columns: 1fr;
  }

  .report-header__title-wrap {
    clip-path: none;
  }

  .report-fields--2,
  .report-fields--3,
  .report-fields--6,
  .report-cols {
    grid-template-columns: 1fr;
  }

  .report-signatures {
    grid-template-columns: 1fr;
  }

  .report-photos {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body.toolkit-public {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .report-toolbar,
  #site-header,
  .toolkit-login-banner,
  .report-logo-input,
  .report-logo-placeholder {
    display: none !important;
  }

  .report-page {
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  #template-mount {
    margin: 0 !important;
    padding: 0 !important;
  }

  .report-sheet {
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    font-size: 10px !important;
  }

  .report-header {
    display: grid !important;
    grid-template-columns: 32mm 1fr 46mm !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .report-header__title-wrap {
    clip-path: none !important;
  }

  .report-fields--2 {
    grid-template-columns: 1fr 1fr !important;
  }

  .report-fields--3 {
    grid-template-columns: 1fr 1fr 1fr !important;
  }

  .report-cols {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .report-section {
    page-break-inside: auto;
    break-inside: auto;
  }

  .report-section__head,
  .report-table thead {
    page-break-after: avoid;
  }

  .report-table tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .report-signatures,
  .report-footer-bar {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .report-table-wrap {
    overflow: visible !important;
  }

  .report-field input,
  .report-field textarea,
  .report-field select,
  .report-table td input,
  .report-table td textarea,
  .report-meta-row input,
  .report-brand-input,
  .report-letter-block textarea {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #000 !important;
    overflow: visible !important;
    min-height: 1em !important;
  }

  .report-field textarea,
  .report-table td textarea,
  .report-letter-block textarea {
    resize: none !important;
    height: auto !important;
    white-space: pre-wrap !important;
    overflow: visible !important;
  }

  input[type='checkbox'] {
    -webkit-appearance: auto !important;
    appearance: auto !important;
    width: 11px !important;
    height: 11px !important;
  }

  .report-logo-img {
    display: block !important;
    max-height: 14mm !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }

  .report-ppe-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .report-checks-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .report-poster__ppe {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  @page {
    size: A4 portrait;
    margin: 10mm;
  }
}
