/*
 * Arbotech Field Operations App
 * Heavy Duty Off-Road Track Vehicle Inspection
 * Extracted from JavaScript during Phase 3.
 */

.heavy-track-inspection-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 6100;
  overflow-y: auto;
  background: #eef2ef;
}

.heavy-track-inspection-screen.open {
  display: block;
}

#heavyTrackInspectionRoot {
  padding: 18px;
}

.heavy-track-document {
  width: min(100%, 1080px);
  margin: 0 auto 40px;
  padding: 24px;
  border: 1px solid #d5ddd7;
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 28px rgba(18, 48, 30, 0.09);
}

.heavy-track-document-header {
  text-align: center;
}

.heavy-track-document-header h1 {
  margin: 0;
  color: #183c24;
  font-size: clamp(22px, 3vw, 31px);
}

.heavy-track-document-header h2 {
  margin: 8px 0 0;
  color: #1f2937;
  font-size: clamp(18px, 2.4vw, 25px);
}

.heavy-track-disclaimer {
  max-width: 820px;
  margin: 14px auto 0;
  padding: 11px 14px;
  border-left: 4px solid #2f6f45;
  border-radius: 8px;
  background: #f1f7f3;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

.heavy-track-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.heavy-track-context > div,
.heavy-track-date-section > div,
.heavy-track-date-section > label {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid #d8e0da;
  border-radius: 9px;
  background: #f8faf9;
}

.heavy-track-context span,
.heavy-track-date-section span,
.heavy-track-completed-signature-details span {
  color: #64748b;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.heavy-track-section {
  margin-top: 20px;
}

.heavy-track-section h3 {
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 2px solid #2f6f45;
  color: #183c24;
}

.heavy-track-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.heavy-track-check-item {
  display: grid;
  grid-template-columns: 30px 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 10px;
  border: 1px solid #d8e0da;
  border-radius: 9px;
  background: #fff;
}

.heavy-track-check-item:has(.heavy-track-check-input:checked) {
  border-color: #8eb59a;
  background: #f2f8f4;
}

.heavy-track-item-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: #e8efe9;
  color: #31553c;
  font-size: 12px;
  font-weight: bold;
}

.heavy-track-check-input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #2f6f45;
}

.heavy-track-check-label {
  color: #263238;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.heavy-track-coolant-field {
  display: flex;
  grid-column: 3;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: bold;
}

.heavy-track-coolant-field input {
  width: 88px;
  padding: 7px;
  border: 1px solid #b9c4bc;
  border-radius: 7px;
  font-size: 14px;
}

.heavy-track-remarks-label {
  display: grid;
  gap: 7px;
  color: #183c24;
  font-weight: bold;
}

.heavy-track-remarks-label textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 2px solid #cfd8d2;
  border-radius: 9px;
  font: inherit;
  line-height: 1.45;
}

.heavy-track-remarks-label textarea:focus,
.heavy-track-date-section input:focus,
.heavy-track-password-label input:focus {
  outline: none;
  border-color: #2f6f45;
}

.heavy-track-date-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(220px, 1fr);
  gap: 10px;
}

.heavy-track-date-section input {
  padding: 9px;
  border: 1px solid #b9c4bc;
  border-radius: 7px;
  font: inherit;
}

.heavy-track-signature-note {
  color: #52616b;
  line-height: 1.5;
}

.heavy-track-password-label {
  display: grid;
  max-width: 430px;
  gap: 6px;
  margin-top: 12px;
  color: #183c24;
  font-weight: bold;
}

.heavy-track-password-label input {
  padding: 11px;
  border: 2px solid #cfd8d2;
  border-radius: 9px;
  font-size: 16px;
}

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

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

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

.heavy-track-signature-pad-actions {
  margin-top: 8px;
}

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

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

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

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

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

.heavy-track-completed-signature-details {
  display: grid;
  gap: 10px;
}

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

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

.heavy-track-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #d8e0da;
}

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

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

.heavy-track-primary-button {
  border: none;
  background: #2f6f45;
  color: white;
}

.heavy-track-secondary-button {
  border: 1px solid #9eaaa2;
  background: white;
  color: #27352c;
}

.heavy-track-primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.heavy-track-available-form-row {
  display: block;
}

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

.heavy-track-available-heading > div {
  display: grid;
  gap: 3px;
}

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

.heavy-track-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid #d4ddd6;
  border-radius: 8px;
  background: #f9fbfa;
  color: #27352c;
  text-align: left;
  cursor: pointer;
}

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

.heavy-track-recent-item small {
  color: #64748b;
}

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

.heavy-track-status-pill.active {
  background: #fff1cc;
  color: #7c5200;
}

.heavy-track-status-pill.completed {
  background: #e4f5e9;
  color: #176534;
}

@media (max-width: 760px) {
  #heavyTrackInspectionRoot {
    padding: 9px;
  }

  .heavy-track-document {
    padding: 15px;
  }

  .heavy-track-context,
  .heavy-track-checklist,
  .heavy-track-date-section,
  .heavy-track-completed-signature {
    grid-template-columns: 1fr;
  }

  .heavy-track-signature-canvas {
    height: 165px;
  }

  .heavy-track-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .heavy-track-actions button {
    width: 100%;
  }

  .heavy-track-save-indicator {
    margin-right: 0;
    text-align: center;
  }
}

@media print {
  body.printing-heavy-track-inspection > * {
    display: none !important;
  }

  body.printing-heavy-track-inspection
  #heavyTrackInspectionScreen {
    display: block !important;
    position: static !important;
    overflow: visible !important;
    background: white !important;
  }

  body.printing-heavy-track-inspection
  #heavyTrackInspectionScreen
  .tailboard-screen-topbar,
  body.printing-heavy-track-inspection
  .heavy-track-actions {
    display: none !important;
  }

  body.printing-heavy-track-inspection
  #heavyTrackInspectionRoot {
    padding: 0 !important;
  }

  body.printing-heavy-track-inspection
  .heavy-track-document {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.printing-heavy-track-inspection
  .heavy-track-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.printing-heavy-track-inspection
  .heavy-track-check-item,
  body.printing-heavy-track-inspection
  .heavy-track-section {
    break-inside: avoid;
  }
}
