/*
 * Arbotech Field Operations App
 * NL Hydro TRO Field Visit
 * Extracted from JavaScript during Phase 3.
 */

.nlh-tro-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 6300;
  overflow-y: auto;
  background: #edf2f4;
}

.nlh-tro-screen.open {
  display: block;
}

#nlhTroFieldVisitRoot {
  padding: 18px;
}

.nlh-tro-document {
  width: min(100%, 1100px);
  margin: 0 auto 40px;
  padding: 24px;
  border: 1px solid #d6dde2;
  border-radius: 14px;
  background: white;
  box-shadow:
    0 8px 28px
    rgba(35, 53, 66, 0.1);
}

.nlh-tro-header {
  display: grid;
  grid-template-columns:
    minmax(190px, 0.62fr)
    minmax(0, 1.38fr);
  align-items: center;
  gap: 24px;
  min-height: 130px;
}

.nlh-tro-logo-area img {
  display: block;
  width: min(100%, 255px);
  height: auto;
  object-fit: contain;
}

.nlh-tro-title-area {
  text-align: center;
}

.nlh-tro-title-area h1 {
  margin: 0;
  color: #3f4c56;
  font-size:
    clamp(21px, 2.8vw, 31px);
  line-height: 1.25;
}

.nlh-tro-primary-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.nlh-tro-primary-grid label,
.nlh-tro-work-order,
.nlh-tro-swop,
.nlh-tro-comments,
.nlh-tro-password-label {
  display: grid;
  gap: 6px;
  color: #2d3840;
  font-weight: bold;
}

.nlh-tro-primary-grid input,
.nlh-tro-work-order input,
.nlh-tro-swop input,
.nlh-tro-comments textarea,
.nlh-tro-password-label input {
  width: 100%;
  padding: 10px;
  border: 2px solid #ccd4da;
  border-radius: 8px;
  background: white;
  color: #17212a;
  font: inherit;
}

.nlh-tro-primary-grid input:focus,
.nlh-tro-work-order input:focus,
.nlh-tro-swop input:focus,
.nlh-tro-comments textarea:focus,
.nlh-tro-password-label input:focus {
  outline: none;
  border-color: #1689bf;
}

.nlh-tro-confirmation-row {
  display: grid;
  grid-template-columns:
    minmax(230px, 1fr)
    minmax(270px, 1.2fr)
    minmax(170px, 0.7fr);
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.nlh-tro-checkbox,
.nlh-tro-check-item,
.nlh-tro-radio {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  border: 1px solid #d3dbe0;
  border-radius: 8px;
  background: white;
  color: #2f3a42;
  font-weight: 600;
  line-height: 1.35;
}

.nlh-tro-checkbox:has(input:checked),
.nlh-tro-check-item:has(input:checked),
.nlh-tro-radio:has(input:checked) {
  border-color: #8ab8cd;
  background: #f0f8fc;
}

.nlh-tro-checkbox input,
.nlh-tro-check-item input,
.nlh-tro-radio input {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: #1389bd;
}

.nlh-tro-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 2px solid #5f6d78;
}

.nlh-tro-section h2 {
  margin: 0;
  color: #3f4c56;
  font-size: 18px;
}

.nlh-tro-checklist-note {
  margin: 6px 0 11px;
  color: #65737d;
  font-size: 13px;
}

.nlh-tro-checklist-columns {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.nlh-tro-checklist-column {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nlh-tro-check-item {
  min-height: 50px;
  font-size: 13px;
}

.nlh-tro-comments textarea {
  resize: vertical;
  line-height: 1.45;
}

.nlh-tro-lower-grid {
  display: grid;
  grid-template-columns:
    minmax(280px, 1fr)
    minmax(220px, 0.8fr);
  align-items: end;
  gap: 14px;
  margin-top: 18px;
}

.nlh-tro-be-safe {
  margin: 0;
  padding: 10px;
  border: 1px solid #cbd4da;
  border-radius: 8px;
}

.nlh-tro-be-safe legend {
  padding: 0 5px;
  color: #3f4c56;
  font-weight: bold;
}

.nlh-tro-be-safe > div {
  display: flex;
  gap: 9px;
}

.nlh-tro-radio {
  flex: 1;
  justify-content: center;
}

.nlh-tro-signature-note {
  color: #5c6871;
  line-height: 1.45;
}

.nlh-tro-password-label {
  max-width: 430px;
  margin-top: 12px;
}

.nlh-tro-signature-pad-wrap {
  position: relative;
  max-width: 720px;
  margin-top: 14px;
  overflow: hidden;
  border: 2px solid #aeb8bf;
  border-radius: 10px;
  background: white;
}

.nlh-tro-signature-canvas {
  display: block;
  width: 100%;
  height: 190px;
  touch-action: none;
  cursor: crosshair;
}

.nlh-tro-signature-line {
  position: absolute;
  right: 30px;
  bottom: 30px;
  left: 30px;
  border-bottom:
    1px solid #9ca3af;
  pointer-events: none;
}

.nlh-tro-signature-pad-actions {
  margin-top: 8px;
}

.nlh-tro-signature-pad-actions button {
  padding: 8px 12px;
  border: 1px solid #aeb8bf;
  border-radius: 8px;
  background: white;
  font-weight: bold;
  cursor: pointer;
}

.nlh-tro-completion-message {
  min-height: 22px;
  margin-top: 8px;
  color: #24587d;
  font-size: 13px;
  font-weight: bold;
}

.nlh-tro-completion-message.error,
.nlh-tro-signature-missing {
  color: #9b1c1c;
}

.nlh-tro-completed-signature {
  display: grid;
  grid-template-columns:
    minmax(240px, 0.8fr)
    minmax(280px, 1.2fr);
  align-items: center;
  gap: 16px;
}

.nlh-tro-completed-signature img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-bottom:
    1px solid #9ca3af;
}

.nlh-tro-completed-signature-details {
  display: grid;
  gap: 10px;
}

.nlh-tro-completed-signature-details > div {
  display: grid;
  gap: 3px;
}

.nlh-tro-completed-signature-details span {
  color: #64748b;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nlh-tro-hash-row code {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.nlh-tro-revision {
  margin-top: 20px;
  color: #687680;
  font-size: 12px;
}

.nlh-tro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #d6dde2;
}

.nlh-tro-save-indicator {
  margin-right: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: bold;
}

.nlh-tro-primary-button,
.nlh-tro-secondary-button {
  padding: 11px 14px;
  border-radius: 9px;
  font-weight: bold;
  cursor: pointer;
}

.nlh-tro-primary-button {
  border: none;
  background: #137fb0;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

.nlh-tro-secondary-button {
  border: 1px solid #9da8b0;
  background: white;
  color: #26333c;
}

.nlh-tro-primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.nlh-tro-available-row {
  display: block;
}

.available-form-row .nlh-tro-available-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nlh-tro-available-heading > div {
  display: grid;
  gap: 3px;
}

.nlh-tro-recent-list {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.nlh-tro-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid #d4dde2;
  border-radius: 8px;
  background: #f9fbfc;
  color: #27343c;
  text-align: left;
  cursor: pointer;
}

.nlh-tro-recent-item > span:first-child {
  display: grid;
  gap: 2px;
}

.nlh-tro-recent-item small {
  color: #64748b;
}

.nlh-tro-status-pill {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

.nlh-tro-status-pill.active {
  background: #fff1cc;
  color: #7c5200;
}

.nlh-tro-status-pill.completed {
  background: #e4f5e9;
  color: #176534;
}

@media (max-width: 800px) {
  #nlhTroFieldVisitRoot {
    padding: 9px;
  }

  .nlh-tro-document {
    padding: 15px;
  }

  .nlh-tro-header,
  .nlh-tro-primary-grid,
  .nlh-tro-confirmation-row,
  .nlh-tro-checklist-columns,
  .nlh-tro-lower-grid,
  .nlh-tro-completed-signature {
    grid-template-columns: 1fr;
  }

  .nlh-tro-logo-area {
    text-align: left;
  }

  .nlh-tro-logo-area img {
    width: min(100%, 220px);
  }

  .nlh-tro-title-area {
    text-align: left;
  }

  .nlh-tro-be-safe > div {
    flex-direction: column;
  }

  .nlh-tro-signature-canvas {
    height: 165px;
  }

  .nlh-tro-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nlh-tro-actions button {
    width: 100%;
  }

  .nlh-tro-save-indicator {
    margin-right: 0;
    text-align: center;
  }
}

@media print {
  body.printing-nlh-tro-field-visit > * {
    display: none !important;
  }

  body.printing-nlh-tro-field-visit
  #nlhTroFieldVisitScreen {
    display: block !important;
    position: static !important;
    overflow: visible !important;
    background: white !important;
  }

  body.printing-nlh-tro-field-visit
  #nlhTroFieldVisitScreen
  .tailboard-screen-topbar,
  body.printing-nlh-tro-field-visit
  .nlh-tro-actions {
    display: none !important;
  }

  body.printing-nlh-tro-field-visit
  #nlhTroFieldVisitRoot {
    padding: 0 !important;
  }

  body.printing-nlh-tro-field-visit
  .nlh-tro-document {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.printing-nlh-tro-field-visit
  .nlh-tro-checklist-columns {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  body.printing-nlh-tro-field-visit
  .nlh-tro-header {
    grid-template-columns:
      minmax(185px, 0.62fr)
      minmax(0, 1.38fr);
  }

  body.printing-nlh-tro-field-visit
  .nlh-tro-section,
  body.printing-nlh-tro-field-visit
  .nlh-tro-check-item,
  body.printing-nlh-tro-field-visit
  .nlh-tro-completed-signature {
    break-inside: avoid;
  }
}
