* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f5f4;
  color: #1f2933;
}

.screen {
  display: none;
  width: 100vw;
  height: 100vh;
}

.active-screen {
  display: block;
}

/* START SCREEN */

#crewScreen {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#crewScreen.active-screen {
  display: flex;
}

#startScreen {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#startScreen.active-screen {
  display: flex;
}

.start-card {
  width: 100%;
  max-width: 420px;
  background: white;
  padding: 28px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.logo-placeholder {
  width: 140px;
  height: 80px;
  margin: 0 auto 18px auto;
  border-radius: 12px;
  background: #1f4d2b;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
}

h1 {
  margin: 10px 0;
  font-size: 28px;
}

.subtitle {
  margin-bottom: 22px;
  color: #536471;
}

.menu-button {
  width: 100%;
  padding: 16px;
  margin: 8px 0;
  border: none;
  border-radius: 12px;
  background: #256d3c;
  color: white;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
}

.menu-button:hover {
  background: #1f5c33;
}

/* MAP SCREEN */

#appScreen.active-screen {
  display: flex;
  flex-direction: column;
}

#topBar {
  height: 58px;
  background: #1f4d2b;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 15px;
  z-index: 1000;
}

#changeJobButton {
  background: white;
  color: #1f4d2b;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: bold;
  cursor: pointer;
}

.top-bar-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

#signOutButton {
  background: white;
  color: #1f4d2b;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: bold;
  cursor: pointer;
}
#map {
  flex: 1;
  width: 100%;
}

#bottomControls {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 1500;
  pointer-events: auto;
}

#bottomControls button {
  display: inline-block;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  white-space: nowrap;
}
.select-label {
  display: block;
  text-align: left;
  margin-bottom: 6px;
  font-weight: bold;
  color: #1f2933;
}

.job-select {
  width: 100%;
  padding: 14px;
  margin-bottom: 16px;
  border: 2px solid #d0d7de;
  border-radius: 12px;
  font-size: 16px;
  background: white;
  color: #1f2933;
}

.job-select:focus {
  outline: none;
  border-color: #256d3c;
}

.side-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100%;
  background: white;
  z-index: 2000;
  padding: 18px;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
  transition: bottom 0.25s ease;
  max-height: 78vh;
  overflow-y: auto;
}

.side-panel.open {
  bottom: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
}

.panel-header button {
  border: none;
  background: #e5e7eb;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 22px;
  cursor: pointer;
}

.side-panel label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-weight: bold;
}

.side-panel select,
.side-panel input,
.side-panel textarea {
  width: 100%;
  padding: 13px;
  border: 2px solid #d0d7de;
  border-radius: 10px;
  font-size: 16px;
}

.side-panel textarea {
  min-height: 90px;
  resize: vertical;
}

.primary-panel-button {
  width: 100%;
  margin-top: 18px;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: #256d3c;
  color: white;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
}

.primary-panel-button:hover {
  background: #1f5c33;
}

.record-marker {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: white;
  border: 3px solid #256d3c;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.record-marker-icon {
  font-size: 18px;
  line-height: 1;
}

.record-popup {
  min-width: 190px;
}

.record-popup button {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.sync-status {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  background: white;
  color: #1f4d2b;
  white-space: nowrap;
}

.sync-online {
  background: #e7f7ed;
  color: #176534;
}

.sync-offline {
  background: #fdecec;
  color: #9b1c1c;
}

.sync-pending {
  background: #fff4d6;
  color: #8a5a00;
}

.sync-syncing {
  background: #e8f0ff;
  color: #1d4ed8;
}

.sync-synced {
  background: #e7f7ed;
  color: #176534;
}

.job-layer-small-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 2px solid #f97316;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.popup-complete-button {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: none;
  border-radius: 8px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.popup-complete-button:hover {
  background: #1f5c33;
}

.record-popup .delete-record-button {
  background: #b91c1c;
  margin-top: 6px;
}

.record-popup .delete-record-button:hover {
  background: #7f1d1d;
}

.record-popup button {
  margin-top: 8px;
}

.maps-button {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
}

.layer-maps-button {
  margin-right: 8px;
  margin-bottom: 6px;
}

.job-layer-popup .maps-button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  margin-top: 12px;
  margin-bottom: 10px;
}

.record-popup .maps-button:hover {
  background: #1d4ed8;
}

#layerButton {
  display: none;
}

.layer-panel {
  max-height: 82vh;
}

.layer-panel-note {
  margin: 0 0 12px 0;
  color: #536471;
  font-size: 14px;
}

.layer-panel-actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 14px 0;
  position: sticky;
  top: 0;
  background: white;
  padding: 8px 0 10px 0;
  z-index: 2;
}

.layer-panel-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #e5e7eb;
  color: #1f2933;
  font-weight: bold;
  cursor: pointer;
}

.layer-panel-actions button:first-child {
  background: #256d3c;
  color: white;
}

.layer-panel-actions button:first-child:hover {
  background: #1f5c33;
}

.layer-panel-actions button:last-child:hover {
  background: #d1d5db;
}

.layer-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #e5e7eb;
  font-weight: bold;
}

.layer-toggle-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  transform: scale(1.25);
}

.layer-toggle-text {
  flex: 1;
}

.layer-toggle-name {
  display: block;
}

.layer-toggle-type {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #536471;
  font-weight: normal;
}

@media (max-width: 600px) {
  #bottomControls {
    width: calc(100% - 24px);
    left: 12px;
    right: 12px;
    bottom: 14px;
    transform: none;
    justify-content: center;
    gap: 8px;
  }

  #bottomControls button {
    flex: 1;
    min-width: 0;
    padding: 12px 8px;
    font-size: 14px;
  }

  .layer-panel {
    max-height: 86vh;
    padding-bottom: 28px;
  }

  .layer-toggle-row {
    padding: 15px 0;
  }
}

.layer-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
}

.layer-toggle-row input[type="checkbox"] {
  margin-right: 12px;
}

.layer-toggle-name {
  flex: 1;
}

.layer-legend-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.layer-legend-swatch {
  border-radius: 3px;
  border: 1px solid #555;
}

.layer-legend-dot {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  border-radius: 50%;
  border: 1px solid #555;
}

.layer-legend-line {
  height: 4px;
  border-radius: 2px;
}

.layer-legend-emoji {
  font-size: 16px;
  line-height: 1;
}

.layer-legend-empty {
  visibility: hidden;
}

.multi-complete-controls {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  background: #f9fafb;
}

.multi-complete-title {
  font-weight: bold;
  margin-bottom: 3px;
}

.multi-complete-help {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 8px;
}

.multi-complete-button-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.multi-complete-button {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #9ca3af;
  background: white;
  cursor: pointer;
  font-size: 12px;
}

.multi-complete-button.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.multi-complete-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.complete-selected-button {
  font-weight: bold;
}
/* -------------------------------------------------------------------------- */
/* FORMS + DAILY TAILBOARD                                                    */
/* -------------------------------------------------------------------------- */

.forms-panel {
  max-height: 86vh;
}

.forms-context-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #d7dfda;
  border-radius: 10px;
  background: #f7faf8;
}

.secondary-panel-button {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid #9ca3af;
  border-radius: 10px;
  background: white;
  color: #1f2933;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.forms-list-heading {
  margin: 22px 0 10px;
}

.forms-list {
  display: grid;
  gap: 10px;
}

.forms-empty-message {
  color: #536471;
  line-height: 1.45;
}

.saved-form-card {
  padding: 13px;
  border: 1px solid #d7dfda;
  border-radius: 12px;
  background: #ffffff;
}

.saved-form-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.saved-form-supervisor {
  margin-top: 7px;
}

.saved-form-meta {
  margin-top: 5px;
  color: #65727c;
  font-size: 12px;
}

.saved-form-open-button {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.form-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.form-status-pill.active {
  background: #fff4d6;
  color: #8a5a00;
}

.form-status-pill.completed {
  background: #e7f7ed;
  color: #176534;
}

.tailboard-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  overflow-y: auto;
  background: #edf2ef;
}

.tailboard-screen.open {
  display: block;
}

.tailboard-screen-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #1f4d2b;
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.tailboard-screen-topbar button {
  justify-self: start;
  padding: 8px 11px;
  border: none;
  border-radius: 8px;
  background: white;
  color: #1f4d2b;
  font-weight: bold;
  cursor: pointer;
}

#tailboardFormRoot {
  padding: 18px;
}

.tailboard-document {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 28px rgba(20, 45, 31, 0.12);
}

.tailboard-document-header {
  text-align: center;
  padding-bottom: 17px;
  border-bottom: 3px solid #1f4d2b;
}

.tailboard-document-header h1 {
  margin: 0;
  color: #173c22;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 4vw, 36px);
}

.tailboard-document-header p {
  margin: 8px 0 0;
  font-weight: bold;
}

.tailboard-context-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 16px 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: #f1f6f3;
}

.tailboard-context-row .form-status-pill {
  margin-left: auto;
}

.tailboard-section {
  margin-top: 13px;
  border: 1px solid #cfd9d3;
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.tailboard-section > summary {
  padding: 15px 16px;
  background: #e9f1ec;
  color: #173c22;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.tailboard-section[open] > summary {
  border-bottom: 1px solid #cfd9d3;
}

.tailboard-section-body {
  padding: 16px;
}

.tailboard-section-body h3 {
  margin: 18px 0 10px;
  color: #244b31;
}

.tailboard-section-body h3:first-child {
  margin-top: 0;
}

.tailboard-grid {
  display: grid;
  gap: 13px;
}

.tailboard-grid.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tailboard-grid.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tailboard-grid.four-column {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tailboard-field {
  display: grid;
  gap: 6px;
  margin: 0;
  font-weight: bold;
}

.tailboard-field > span {
  color: #293b31;
}

.tailboard-field input,
.tailboard-field select,
.tailboard-field textarea,
.choice-fieldset input,
.hazard-card input,
.hazard-card select,
.hazard-card textarea {
  font: inherit;
}

.tailboard-field input,
.tailboard-field select,
.tailboard-field textarea,
.hazard-card input[type="text"],
.hazard-card input[type="date"],
.hazard-card select,
.hazard-card textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid #b9c5be;
  border-radius: 9px;
  background: white;
  color: #1f2933;
}

.tailboard-field input:focus,
.tailboard-field select:focus,
.tailboard-field textarea:focus,
.hazard-card input:focus,
.hazard-card select:focus,
.hazard-card textarea:focus {
  outline: 3px solid rgba(37, 109, 60, 0.14);
  border-color: #256d3c;
}

.tailboard-field textarea,
.hazard-card textarea {
  min-height: 82px;
  resize: vertical;
}

.tailboard-field input[readonly],
.tailboard-field textarea[readonly],
.hazard-card textarea[readonly] {
  background: #f5f7f6;
  color: #44524a;
}

.repeatable-section {
  margin-top: 18px;
}

.repeatable-heading-row,
.feeder-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.repeatable-heading-row h3,
.feeder-card-heading h3 {
  margin: 0;
}

.repeatable-row {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

.repeatable-field {
  flex: 1;
}

.small-add-button,
.remove-item-button {
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.small-add-button {
  border: none;
  background: #256d3c;
  color: white;
}

.remove-item-button {
  flex: 0 0 auto;
  border: 1px solid #dcaaaa;
  background: #fff5f5;
  color: #991b1b;
}

.feeder-card,
.inspection-card,
.hazard-card,
.acknowledgement-box {
  margin-bottom: 13px;
  padding: 14px;
  border: 1px solid #d3dcd7;
  border-radius: 11px;
  background: #fbfcfb;
}

.feeder-card:last-child,
.inspection-card:last-child,
.hazard-card:last-child {
  margin-bottom: 0;
}

.choice-fieldset {
  min-width: 0;
  margin: 12px 0 0;
  padding: 10px 12px 12px;
  border: 1px solid #c7d1cb;
  border-radius: 9px;
}

.choice-fieldset legend {
  padding: 0 5px;
  color: #293b31;
  font-weight: bold;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wrap-choice-row {
  flex-wrap: wrap;
}

.radio-option,
.check-option,
.inspection-toggle,
.hazard-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.radio-option input,
.check-option input,
.inspection-toggle input,
.hazard-step-heading input {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.checkbox-grid.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-option {
  min-height: 44px;
  padding: 10px;
  border: 1px solid #d6ded9;
  border-radius: 8px;
  background: white;
}

.other-details-field {
  margin-top: 13px;
}

.emergency-contact-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 2px solid #b91c1c;
  border-radius: 10px;
  background: #fff5f5;
  color: #7f1d1d;
  font-size: 16px;
}

.emergency-contacts-select {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid #b91c1c;
  border-radius: 8px;
  background: #ffffff;
  color: #7f1d1d;
  font: inherit;
  font-weight: bold;
}

.compact-emergency-card {
  margin-bottom: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.utility-contact-section {
  margin-top: 15px;
}

.hazard-ranking-note {
  padding: 12px;
  margin-bottom: 13px;
  border-left: 4px solid #d39c0d;
  background: #fff9e8;
  line-height: 1.45;
}

.hazard-step-heading {
  align-items: center;
  font-size: 16px;
  font-weight: bold;
}

.hazard-card-body {
  display: none;
  margin-top: 13px;
}

.hazard-card.selected {
  border-color: #76a884;
  background: #f5faf6;
}

.hazard-card.selected .hazard-card-body {
  display: block;
}

.inspection-toggle {
  align-items: center;
  font-size: 16px;
  font-weight: bold;
}

.inspection-fields {
  display: none;
  margin-top: 14px;
}

.inspection-fields.visible {
  display: block;
}

.fall-protection-toggle {
  padding: 12px;
  border-radius: 9px;
  background: #f5faf6;
}

.section-help-text {
  color: #536471;
}

.short-field {
  max-width: 360px;
  margin-bottom: 12px;
}

.calculated-field small {
  color: #65727c;
  font-weight: normal;
}

.acknowledgement-box p {
  margin-top: 0;
  line-height: 1.5;
}

.acknowledgement-option {
  margin-top: 9px;
  min-height: 0;
}

.tailboard-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #d7dfda;
}

.tailboard-action-bar button {
  flex: 1;
  min-width: 180px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.secondary-action-button {
  border: 1px solid #256d3c;
  background: white;
  color: #256d3c;
}

.complete-tailboard-button {
  border: none;
  background: #256d3c;
  color: white;
}

.link-action-button {
  border: 1px solid #c7d1cb;
  background: #f3f5f4;
  color: #293b31;
}

.tailboard-save-indicator {
  margin-top: 11px;
  text-align: center;
  color: #65727c;
  font-size: 13px;
}

.tailboard-document input:disabled,
.tailboard-document select:disabled,
.tailboard-document textarea:disabled,
.tailboard-document button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

@media (max-width: 800px) {
  #tailboardFormRoot {
    padding: 10px;
  }

  .tailboard-document {
    padding: 14px;
    border-radius: 10px;
  }

  .tailboard-grid.two-column,
  .tailboard-grid.three-column,
  .tailboard-grid.four-column {
    grid-template-columns: 1fr;
  }

  .checkbox-grid,
  .checkbox-grid.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-emergency-card {
    grid-template-columns: 1fr;
  }

  .tailboard-context-row .form-status-pill {
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .tailboard-screen-topbar {
    grid-template-columns: auto 1fr;
  }

  .tailboard-screen-topbar strong {
    justify-self: end;
  }

  .tailboard-screen-topbar span {
    display: none;
  }

  .tailboard-section-body {
    padding: 12px;
  }

  .repeatable-heading-row,
  .feeder-card-heading {
    align-items: flex-start;
  }

  .repeatable-row {
    align-items: stretch;
    flex-direction: column;
  }

  .remove-item-button {
    align-self: flex-end;
  }

  .checkbox-grid,
  .checkbox-grid.compact-grid {
    grid-template-columns: 1fr;
  }

  .choice-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .full-width-mobile {
    width: 100%;
  }

  .tailboard-action-bar {
    flex-direction: column;
  }

  .tailboard-action-bar button {
    width: 100%;
    min-width: 0;
  }
}


/* -------------------------------------------------------------------------- */
/* COMPLETED TAILBOARDS                                                       */
/* -------------------------------------------------------------------------- */

.completed-tailboards-panel-button {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: #1f4d2b;
  color: white;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.completed-tailboards-panel-button:hover {
  background: #173c22;
}

.completed-tailboards-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4900;
  overflow-y: auto;
  background: #edf2ef;
}

.completed-tailboards-screen.open {
  display: block;
}

.completed-tailboards-topbar button:last-child {
  justify-self: end;
}

.completed-tailboards-topbar button:disabled {
  opacity: 0.7;
  cursor: wait;
}

#completedTailboardsRoot {
  padding: 18px;
}

.completed-tailboards-page {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

.completed-tailboards-loading,
.completed-tailboards-empty {
  padding: 26px;
  border: 1px solid #d7dfda;
  border-radius: 12px;
  background: white;
  color: #536471;
  text-align: center;
}

.completed-tailboards-header-card,
.completed-tailboards-filter-card {
  padding: 18px;
  border: 1px solid #d7dfda;
  border-radius: 14px;
  background: white;
  box-shadow: 0 5px 18px rgba(20, 45, 31, 0.08);
}

.completed-tailboards-header-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.completed-tailboards-header-card h1 {
  margin: 0;
  color: #173c22;
  font-size: 27px;
}

.completed-tailboards-header-card p {
  margin: 7px 0 0;
  color: #536471;
}

.completed-tailboards-context {
  display: grid;
  gap: 5px;
  min-width: 260px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #f1f6f3;
}

.completed-tailboards-filter-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(220px, 1.6fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.completed-tailboards-filter-card label {
  display: grid;
  gap: 6px;
  font-weight: bold;
}

.completed-tailboards-filter-card input {
  width: 100%;
  padding: 11px;
  border: 2px solid #d0d7de;
  border-radius: 9px;
  font-size: 15px;
}

.completed-tailboards-filter-card input:focus {
  outline: none;
  border-color: #256d3c;
}

.clear-completed-filters-button {
  min-height: 44px;
  padding: 11px 15px;
  border: 1px solid #9ca3af;
  border-radius: 9px;
  background: white;
  color: #1f2933;
  font-weight: bold;
  cursor: pointer;
}

.completed-tailboards-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 2px 10px;
  color: #536471;
}

.completed-tailboards-list {
  display: grid;
  gap: 12px;
}

.completed-tailboard-card {
  padding: 16px;
  border: 1px solid #d7dfda;
  border-radius: 14px;
  background: white;
  box-shadow: 0 4px 14px rgba(20, 45, 31, 0.07);
}

.completed-tailboard-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.completed-tailboard-date {
  color: #173c22;
  font-size: 19px;
  font-weight: bold;
}

.completed-tailboard-supervisor {
  margin-top: 4px;
  color: #43524a;
}

.completed-tailboard-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.completed-tailboard-details > div {
  padding: 10px;
  border-radius: 9px;
  background: #f5f8f6;
}

.completed-tailboard-details dt {
  color: #65727c;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.completed-tailboard-details dd {
  margin: 5px 0 0;
  color: #1f2933;
  font-weight: bold;
}

.completed-tailboard-location {
  margin-top: 12px;
  line-height: 1.45;
}

.completed-tailboard-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #e1e7e3;
}

.completed-tailboard-card-footer button {
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.completed-sync-ok {
  color: #176534;
  font-weight: bold;
}

.completed-sync-pending {
  color: #8a5a00;
  font-weight: bold;
}

.tailboard-time-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 16px;
  border: 1px solid #cfd9d3;
  border-radius: 10px;
  overflow: hidden;
}

.tailboard-time-table > div {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  background: #fbfcfb;
}

.tailboard-time-table > div + div {
  border-left: 1px solid #cfd9d3;
}

.tailboard-time-table span {
  color: #65727c;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

@media (max-width: 800px) {
  .completed-tailboards-header-card {
    display: grid;
  }

  .completed-tailboards-context {
    min-width: 0;
  }

  .completed-tailboards-filter-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .completed-tailboards-search-field {
    grid-column: 1 / -1;
  }

  .clear-completed-filters-button {
    grid-column: 1 / -1;
  }

  .completed-tailboard-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #completedTailboardsRoot {
    padding: 10px;
  }

  .completed-tailboards-topbar {
    grid-template-columns: auto 1fr auto;
  }

  .completed-tailboards-topbar strong {
    justify-self: center;
    font-size: 14px;
  }

  .completed-tailboards-topbar button {
    padding: 7px 8px;
    font-size: 12px;
  }

  .completed-tailboards-filter-card,
  .completed-tailboard-details,
  .tailboard-time-table {
    grid-template-columns: 1fr;
  }

  .completed-tailboard-card-footer,
  .completed-tailboards-summary-row {
    align-items: stretch;
    flex-direction: column;
  }

  .completed-tailboard-card-footer button {
    width: 100%;
  }

  .tailboard-time-table > div + div {
    border-top: 1px solid #cfd9d3;
    border-left: none;
  }
}

@media print {
  body {
    background: white !important;
  }

  body > *:not(#tailboardScreen) {
    display: none !important;
  }

  #tailboardScreen {
    display: block !important;
    position: static !important;
    overflow: visible !important;
    background: white !important;
  }

  .tailboard-screen-topbar,
  .tailboard-action-bar,
  .tailboard-save-indicator {
    display: none !important;
  }

  #tailboardFormRoot {
    padding: 0 !important;
  }

  .tailboard-document {
    max-width: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .tailboard-section,
  .inspection-card,
  .hazard-card {
    break-inside: avoid;
  }

  .tailboard-section > summary {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .tailboard-document input:disabled,
  .tailboard-document select:disabled,
  .tailboard-document textarea:disabled {
    opacity: 1 !important;
    color: black !important;
    -webkit-text-fill-color: black !important;
  }
}


/* -------------------------------------------------------------------------- */
/* SUPABASE AUTH STAGE 1                                                      */
/* -------------------------------------------------------------------------- */

#authScreen {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#authScreen.active-screen {
  display: flex;
}

.auth-card form {
  text-align: left;
}

.auth-status {
  min-height: 22px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.auth-working {
  color: #1d4ed8;
}

.auth-error {
  color: #9b1c1c;
}

.auth-success {
  color: #176534;
}

.auth-help-text {
  margin: 14px 0 0;
  color: #65727c;
  font-size: 13px;
  line-height: 1.45;
}

.auth-forgot-password-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: #244f78;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
}

.auth-forgot-password-link:hover {
  text-decoration: underline;
}

#forgotPasswordStatus,
#passwordResetStatus {
  min-height: 22px;
  margin-top: 12px;
  color: #244f78;
  font-size: 13px;
  font-weight: bold;
}

#forgotPasswordStatus.error,
#passwordResetStatus.error {
  color: #9b1c1c;
}

#forgotPasswordStatus.success,
#passwordResetStatus.success {
  color: #176534;
}

.secondary-menu-button {
  background: #e5e7eb;
  color: #1f2933;
}

.secondary-menu-button:hover {
  background: #d1d5db;
}

.signed-in-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 18px;
  padding: 12px;
  border-radius: 10px;
  background: #f1f6f3;
  text-align: left;
}

.signed-in-summary div {
  display: grid;
  gap: 3px;
}

.signed-in-summary span:not(.role-badge) {
  color: #65727c;
  font-size: 13px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-supervisor {
  background: #dbeafe;
  color: #1e40af;
}

.role-admin {
  background: #f3e8ff;
  color: #6b21a8;
}


.access-message {
  min-height: 20px;
  margin: -8px 0 8px;
  color: #9b1c1c;
  font-size: 13px;
  font-weight: bold;
  text-align: left;
}

.selection-screen-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.selection-screen-actions button {
  flex: 1;
  padding: 11px;
  border: 1px solid #aeb8b1;
  border-radius: 9px;
  background: white;
  color: #1f2933;
  font-weight: bold;
  cursor: pointer;
}

#topBar {
  min-height: 66px;
  height: auto;
  gap: 12px;
}

.top-bar-context {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.top-bar-context > div {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.top-bar-context .role-badge {
  margin-left: 4px;
}

.top-bar-divider {
  opacity: 0.65;
  margin: 0 2px;
}

#completedFormsTopBarButton,
#changeCrewButton,
#changeJobButton,
#signOutButton {
  background: white;
  color: #1f4d2b;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: bold;
  cursor: pointer;
}

@media (max-width: 760px) {
  #topBar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .top-bar-context {
    flex: 1 1 calc(100% - 100px);
    font-size: 13px;
  }

  .top-bar-context > div:last-child {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #syncStatus {
    align-self: flex-start;
  }

  .top-bar-buttons {
    flex: 1 1 100%;
    justify-content: stretch;
  }

  .top-bar-buttons button {
    flex: 1;
    padding: 8px 6px;
    font-size: 12px;
  }
}


/* -------------------------------------------------------------------------- */
/* VEHICLE CONTEXT AND ADMINISTRATION                                         */
/* -------------------------------------------------------------------------- */

.vehicle-admin-menu-button {
  background: #5b2a86;
}

.vehicle-admin-menu-button:hover {
  background: #47206a;
}

.admin-hub-menu-button {
  background: #3a3f47;
}

.admin-hub-menu-button:hover {
  background: #262a30;
}

.available-forms-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.available-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #d7dfda;
  border-radius: 9px;
  background: #f8fbf9;
}

.available-form-row > div {
  display: grid;
  gap: 3px;
}

.available-form-row span {
  color: #65727c;
  font-size: 12px;
}

.available-form-row.coming-soon {
  opacity: 0.72;
}

.available-form-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f7ed;
  color: #176534 !important;
  font-weight: bold;
}

.available-form-row.coming-soon .available-form-status {
  background: #fff4d6;
  color: #8a5a00 !important;
}

.available-form-start-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: #1f5132;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.vehicle-admin-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5200;
  overflow-y: auto;
  background: #edf2ef;
}

.vehicle-admin-screen.open {
  display: block;
}

#vehicleAdminRoot,
#safetyDocumentsAdminRoot,
#safetyDocumentsRoot {
  padding: 18px;
}

.vehicle-admin-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.admin-hub-page {
  display: flex;
  justify-content: center;
  padding: 40px 18px;
}

.admin-hub-card .menu-button {
  text-align: center;
}

.vehicle-admin-intro,
.vehicle-admin-card {
  padding: 18px;
  border: 1px solid #d7dfda;
  border-radius: 14px;
  background: white;
  box-shadow: 0 5px 18px rgba(20, 45, 31, 0.08);
}

.vehicle-admin-intro h1,
.vehicle-admin-card h2 {
  margin: 0;
  color: #173c22;
}

.vehicle-admin-intro p {
  margin: 8px 0 0;
  color: #536471;
}

.vehicle-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

.vehicle-admin-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.vehicle-admin-card-heading button {
  padding: 8px 11px;
  border: 1px solid #aeb8b1;
  border-radius: 8px;
  background: white;
  font-weight: bold;
  cursor: pointer;
}

.vehicle-admin-card form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d7dfda;
  border-radius: 11px;
  background: #f8fbf9;
}

.vehicle-admin-card form > label {
  display: grid;
  gap: 6px;
  font-weight: bold;
}

.vehicle-admin-card input[type="text"],
.vehicle-admin-card select {
  width: 100%;
  padding: 11px;
  border: 2px solid #d0d7de;
  border-radius: 9px;
  background: white;
  font-size: 15px;
}

.vehicle-admin-card input:focus,
.vehicle-admin-card select:focus {
  outline: none;
  border-color: #256d3c;
}

.vehicle-admin-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vehicle-admin-two-column label {
  display: grid;
  gap: 6px;
  font-weight: bold;
}

.vehicle-form-assignment-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid #cfd9d3;
  border-radius: 9px;
}

.vehicle-form-assignment-fieldset legend {
  padding: 0 6px;
  font-weight: bold;
}

.vehicle-form-assignment-fieldset p {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: #65727c;
  font-size: 12px;
}

.vehicle-form-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: normal !important;
}

.vehicle-form-option input {
  width: auto !important;
}

.vehicle-admin-active-row {
  display: flex !important;
  align-items: center;
  gap: 9px;
}

.vehicle-admin-active-row input {
  width: auto !important;
}

.vehicle-admin-save-button {
  padding: 12px;
  border: none;
  border-radius: 9px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.vehicle-admin-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.vehicle-admin-list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d7dfda;
  border-radius: 10px;
  background: white;
}

.vehicle-admin-list-card.inactive {
  opacity: 0.62;
}

.vehicle-admin-list-card > div:first-child {
  display: grid;
  gap: 3px;
}

.vehicle-admin-list-card span,
.vehicle-admin-list-card small {
  color: #65727c;
}

.vehicle-admin-list-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.vehicle-admin-list-actions button {
  padding: 7px 11px;
  border: none;
  border-radius: 7px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.vehicle-admin-status {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.vehicle-admin-empty {
  color: #65727c;
  text-align: center;
}

.vehicle-admin-forms-hint {
  color: #65727c;
  font-style: italic;
  font-size: 0.9em;
}

.vehicle-admin-list-actions .delete-record-button {
  background: #b91c1c;
  color: white;
  border: none;
}

.vehicle-admin-list-actions .delete-record-button:hover {
  background: #7f1d1d;
}

.vehicle-admin-card input[type="date"],
.vehicle-admin-card input[type="file"],
.vehicle-admin-card textarea {
  width: 100%;
  padding: 11px;
  border: 2px solid #d0d7de;
  border-radius: 9px;
  background: white;
  font-size: 15px;
  font: inherit;
}

.vehicle-admin-card textarea {
  min-height: 70px;
  resize: vertical;
}

.safety-doc-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.safety-doc-filter-bar input,
.safety-doc-filter-bar select {
  padding: 10px;
  border: 2px solid #d0d7de;
  border-radius: 9px;
  font-size: 14px;
}

@media (max-width: 700px) {
  .safety-doc-filter-bar {
    grid-template-columns: 1fr;
  }
}

.safety-doc-viewer-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.safety-doc-viewer-job-picker {
  padding: 12px 14px;
  border: 1px solid #d7dfda;
  border-radius: 10px;
  background: #f8fbf9;
}

.safety-doc-viewer-job-picker label {
  display: grid;
  gap: 6px;
  font-weight: bold;
}

.safety-doc-viewer-job-picker select {
  padding: 10px;
  border: 2px solid #d0d7de;
  border-radius: 9px;
  font-size: 15px;
  background: white;
}

.safety-doc-viewer-section {
  padding: 16px;
  border: 1px solid #d7dfda;
  border-radius: 12px;
  background: #ffffff;
}

.safety-doc-viewer-section h2 {
  margin: 0 0 12px;
}

.safety-doc-group-heading {
  margin: 14px 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4b5a52;
}

.safety-doc-group-heading:first-of-type {
  margin-top: 0;
}

.safety-doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.safety-doc-viewer-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d7dfda;
  border-radius: 10px;
  background: #f8fbf9;
}

.safety-doc-viewer-card > div {
  display: grid;
  gap: 4px;
}

.safety-doc-viewer-card span {
  color: #65727c;
  font-size: 13px;
}

.safety-doc-viewer-card small {
  color: #4b5a52;
}

.safety-doc-viewer-card button {
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

@media (max-width: 540px) {
  .safety-doc-card-grid {
    grid-template-columns: 1fr;
  }
}

#tailboardSupervisor[readonly] {
  background: #eef2ef;
  color: #374151;
  cursor: not-allowed;
}

@media (max-width: 850px) {
  .vehicle-admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  #vehicleAdminRoot,
  #safetyDocumentsAdminRoot,
  #safetyDocumentsRoot {
    padding: 10px;
  }

  .vehicle-admin-two-column,
  .vehicle-form-assignment-fieldset {
    grid-template-columns: 1fr;
  }

  .vehicle-admin-list-card {
    align-items: stretch;
    flex-direction: column;
  }

  .vehicle-admin-list-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}


/* -------------------------------------------------------------------------- */
/* DAILY TAILBOARD AUTHENTICATED SIGNING                                      */
/* -------------------------------------------------------------------------- */

.tailboard-employee-account-row select {
  width: 100%;
  padding: 13px;
  border: 2px solid #d0d7de;
  border-radius: 10px;
  background: white;
  font-size: 16px;
}

.tailboard-employee-account-row select:focus {
  outline: none;
  border-color: #256d3c;
}

.tailboard-employee-account-row small {
  display: block;
  margin-top: 5px;
  color: #65727c;
  font-size: 12px;
}

.tailboard-signing-readiness {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tailboard-signing-readiness > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d7dfda;
  border-radius: 9px;
  background: #f8fbf9;
}

.tailboard-signing-readiness span {
  color: #8a5a00;
  font-size: 12px;
  font-weight: bold;
}

.tailboard-signing-note {
  margin-top: 12px;
  color: #65727c;
  font-size: 12px;
}

.tailboard-signature-summary-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tailboard-signature-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #b9d8c3;
  border-radius: 9px;
  background: #edf8f1;
}

.tailboard-signature-summary-row > div {
  display: grid;
  gap: 3px;
}

.tailboard-signature-summary-row > div:last-child {
  text-align: right;
}

.tailboard-signature-summary-row span {
  color: #536471;
  font-size: 12px;
}

.tailboard-signing-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 7000;
  overflow-y: auto;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
}

.tailboard-signing-modal.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#tailboardSigningContent {
  width: 100%;
  max-width: 760px;
  margin: auto;
}

.tailboard-signing-loading,
.tailboard-signing-dialog-card {
  border-radius: 16px;
  background: white;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.tailboard-signing-loading {
  padding: 28px;
  color: #536471;
  font-weight: bold;
  text-align: center;
}

.tailboard-signing-dialog-card {
  overflow: hidden;
}

.tailboard-signing-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  background: #1f4d2b;
  color: white;
}

.tailboard-signing-dialog-heading h2 {
  margin: 0;
}

.tailboard-signing-dialog-heading p {
  margin: 6px 0 0;
  opacity: 0.88;
}

.tailboard-signing-close-button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.tailboard-signing-acknowledgement {
  margin: 18px 18px 0;
  padding: 13px;
  border-left: 4px solid #256d3c;
  border-radius: 8px;
  background: #f1f6f3;
  line-height: 1.5;
}

.tailboard-signing-revision {
  margin: 10px 18px 0;
  color: #65727c;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.tailboard-signer-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.tailboard-signer-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(280px, 1.4fr);
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid #d7dfda;
  border-radius: 11px;
}

.tailboard-signer-row.signed {
  border-color: #9bc8a8;
  background: #edf8f1;
}

.tailboard-signer-identity,
.tailboard-signer-confirmed {
  display: grid;
  gap: 4px;
}

.tailboard-signer-identity span,
.tailboard-signer-confirmed span {
  color: #65727c;
  font-size: 12px;
}

.tailboard-signer-confirmed {
  justify-items: end;
  color: #176534;
}

.tailboard-signer-password {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 9px;
}

.tailboard-signer-password label {
  display: grid;
  gap: 5px;
  font-weight: bold;
}

.tailboard-signer-password input {
  width: 100%;
  padding: 11px;
  border: 2px solid #d0d7de;
  border-radius: 9px;
  font-size: 15px;
}

.tailboard-signer-password input:focus {
  outline: none;
  border-color: #256d3c;
}

.tailboard-signer-password button {
  min-height: 43px;
  padding: 10px 15px;
  border: none;
  border-radius: 9px;
  background: #256d3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.tailboard-signer-message {
  grid-column: 2;
  min-height: 18px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: bold;
}

.tailboard-signer-message.error {
  color: #9b1c1c;
}

.tailboard-signing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-top: 1px solid #d7dfda;
  background: #f8fbf9;
}

.tailboard-signing-footer p {
  margin: 0;
  color: #536471;
  font-size: 13px;
}

.tailboard-signing-footer > div {
  display: flex;
  gap: 9px;
}

.tailboard-signing-footer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 650px) {
  .tailboard-signing-modal {
    padding: 8px;
  }

  .tailboard-signer-row {
    grid-template-columns: 1fr;
  }

  .tailboard-signer-confirmed {
    justify-items: start;
  }

  .tailboard-signer-password {
    grid-template-columns: 1fr;
  }

  .tailboard-signer-message {
    grid-column: 1;
  }

  .tailboard-signing-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .tailboard-signing-footer > div {
    display: grid;
  }

  .tailboard-signing-readiness > div,
  .tailboard-signature-summary-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .tailboard-signature-summary-row > div:last-child {
    text-align: left;
  }
}

@media print {
  .tailboard-signing-modal {
    display: none !important;
  }
}


/* -------------------------------------------------------------------------- */
/* DOCUSIGN-STYLE MAIN SUPERVISOR SIGNATURE                                   */
/* -------------------------------------------------------------------------- */

.tailboard-drawn-signature-section {
  margin: 0 18px 18px;
  padding: 16px;
  border: 1px solid #cfd9d3;
  border-radius: 12px;
  background: #f8fbf9;
}

.tailboard-drawn-signature-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.tailboard-drawn-signature-heading h3 {
  margin: 0;
  color: #173c22;
}

.tailboard-drawn-signature-heading p {
  margin: 5px 0 0;
  color: #65727c;
  font-size: 13px;
}

.tailboard-signature-readiness {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff4d6;
  color: #8a5a00;
  font-size: 12px;
  font-weight: bold;
}

.tailboard-signature-readiness.ready {
  background: #e7f7ed;
  color: #176534;
}

.tailboard-signature-canvas-wrap {
  position: relative;
  overflow: hidden;
  border: 2px solid #aeb8b1;
  border-radius: 10px;
  background: white;
}

#tailboardSupervisorSignatureCanvas {
  display: block;
  width: 100%;
  height: 190px;
  cursor: crosshair;
  touch-action: none;
}

.tailboard-signature-baseline {
  position: absolute;
  right: 7%;
  bottom: 34px;
  left: 7%;
  border-bottom: 1px solid #8b9690;
  pointer-events: none;
}

.tailboard-signature-canvas-actions {
  display: flex;
  gap: 9px;
  margin-top: 10px;
}

.tailboard-signature-consent {
  margin: 12px 0 0;
  color: #536471;
  font-size: 12px;
  line-height: 1.45;
}

.tailboard-supervisor-reconfirm-note {
  grid-column: 2;
  color: #8a5a00;
  font-size: 12px;
  font-weight: bold;
}

.completed-supervisor-signature-block {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #9bc8a8;
  border-radius: 11px;
  background: #f4fbf6;
}

.completed-supervisor-signature-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.completed-supervisor-signature-heading > div {
  display: grid;
  gap: 4px;
}

.completed-supervisor-signature-heading > div:last-child {
  text-align: right;
}

.completed-supervisor-signature-heading span {
  color: #65727c;
  font-size: 12px;
}

.completed-supervisor-signature-image-wrap {
  display: grid;
  place-items: center;
  min-height: 120px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #cfd9d3;
  border-radius: 9px;
  background: white;
}

.completed-supervisor-signature-image {
  display: block;
  width: min(100%, 520px);
  max-height: 150px;
  object-fit: contain;
}

.signature-image-loading {
  color: #65727c;
  font-size: 12px;
}

.completed-signature-audit {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.completed-signature-audit > div {
  display: grid;
  gap: 3px;
}

.completed-signature-audit span {
  color: #65727c;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.completed-signature-audit code {
  overflow-wrap: anywhere;
  color: #374151;
  font-size: 11px;
}

@media (max-width: 650px) {
  .tailboard-drawn-signature-heading,
  .completed-supervisor-signature-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .completed-supervisor-signature-heading > div:last-child {
    text-align: left;
  }

  .tailboard-signature-canvas-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tailboard-supervisor-reconfirm-note {
    grid-column: 1;
  }
}

@media print {
  .tailboard-drawn-signature-section {
    display: none !important;
  }

  .completed-supervisor-signature-block {
    break-inside: avoid;
  }

  .completed-supervisor-signature-image-wrap {
    min-height: 90px;
  }

  .completed-supervisor-signature-image {
    max-height: 120px;
  }

  .signature-image-loading {
    display: none;
  }
}


/* -------------------------------------------------------------------------- */
/* TOWING SELECTION AND ADMINISTRATION                                        */
/* -------------------------------------------------------------------------- */

#towingQuestionScreen,
#towableSelectionScreen {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#towingQuestionScreen.active-screen,
#towableSelectionScreen.active-screen {
  display: flex;
}

.towable-admin-menu-button {
  background: #7a4b14;
}

.towable-admin-menu-button:hover {
  background: #603a0f;
}

.towable-selection-summary {
  margin: -8px 0 16px;
  padding: 9px 11px;
  border: 1px solid #d7dfda;
  border-radius: 9px;
  background: #f8fbf9;
  color: #536471;
  font-size: 13px;
  font-weight: bold;
}


/* -------------------------------------------------------------------------- */
/* Shared form framework validation feedback                                  */
/* -------------------------------------------------------------------------- */
.arbotech-form-field-error {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

[aria-invalid="true"] {
  scroll-margin-top: 5rem;
}


/* -------------------------------------------------------------------------- */
/* CONSOLIDATED EQUIPMENT ADMINISTRATION                                      */
/* -------------------------------------------------------------------------- */

.equipment-admin-choice-page {
  padding: 18px;
}

.equipment-admin-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.equipment-admin-choice-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 28px;
  border: 2px solid #c7d2cb;
  border-radius: 16px;
  background: #ffffff;
  color: #173c22;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(20, 45, 31, 0.08);
}

.equipment-admin-choice-card:hover,
.equipment-admin-choice-card:focus-visible {
  border-color: #256d3c;
  background: #f5faf6;
}

.equipment-admin-choice-card strong {
  font-size: 1.3rem;
}

.equipment-admin-choice-card small {
  max-width: 340px;
  color: #536471;
  font-size: 0.95rem;
  line-height: 1.45;
}

.equipment-admin-choice-icon {
  font-size: 3rem;
}

.vehicle-form-option {
  align-items: start;
}

.vehicle-form-option .vehicle-form-source-note {
  grid-column: 2;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: normal;
}

.vehicle-form-option.inherited-form-option {
  background: #f2f7f3;
  border-color: #a8c7b0;
}

.vehicle-form-option.inherited-form-option span {
  color: #315b3d;
}

@media (max-width: 720px) {
  .equipment-admin-choice-grid {
    grid-template-columns: 1fr;
  }

  .equipment-admin-choice-card {
    min-height: 170px;
  }
}


/* CATEGORIZED GIS LAYER LEGENDS */
.layer-legend-icon.layer-legend-categories {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  align-content: center;
  justify-content: center;
  gap: 2px;
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 2px;
  border: 1px solid #aab8af;
  border-radius: 5px;
  background: #ffffff;
}

.layer-legend-category-swatch {
  display: block;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(15, 23, 42, 0.35);
  border-radius: 2px;
}
