/* Engineer Job Sheets — shared SHEPHERD glass workspace treatment. */
.job-sheet-page {
  --js-ink: var(--sh-ink, #0b2945);
  --js-muted: var(--sh-muted, #526f88);
  --js-forest: var(--sh-forest, #087859);
  --js-line: var(--sh-line, #d7e3e3);
  --js-surface: rgba(255, 255, 255, .68);
  --js-hover: rgba(237, 248, 244, .82);
  box-sizing: border-box;
  display: grid;
  align-content: start;
  gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 0 0 28px;
  color: var(--js-ink);
  font: 400 14px/1.45 var(--sh-font, Arial, sans-serif);
}

.job-sheet-page *,
.job-sheet-page *::before,
.job-sheet-page *::after,
.job-sheet-dialog *,
.job-sheet-dialog *::before,
.job-sheet-dialog *::after {
  box-sizing: border-box;
}

.job-sheet-page :is(button, input, select, textarea),
.job-sheet-dialog :is(button, input, select, textarea) {
  font: inherit;
}

.job-sheet-page :is(button, input, select, textarea, [tabindex]):focus-visible,
.job-sheet-dialog :is(button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid rgba(11, 143, 120, .42);
  outline-offset: 2px;
}

.job-sheet-page .job-sheet-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  margin: 0;
}

.job-sheet-page .job-sheet-kicker {
  display: block;
  margin: 0 0 5px;
  color: var(--js-forest);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .09em;
}

.job-sheet-page .job-sheet-hero h1 {
  margin: 0;
  color: var(--js-ink);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.job-sheet-page .job-sheet-hero p {
  margin: 5px 0 0;
  color: var(--js-muted);
  font-size: 13px;
  line-height: 1.5;
}

.job-sheet-page .job-sheet-hero-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
}

.job-sheet-page [data-draft-status] {
  color: var(--js-muted);
  font-size: 12px;
}

.job-sheet-page .job-sheet-hero-actions .button-secondary,
.job-sheet-page .sheet-list-toolbar button,
.job-sheet-page .sheet-record-actions button {
  min-height: 38px;
  padding: 7px 11px;
  color: var(--js-forest);
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
}

.job-sheet-page .job-sheet-hero-actions .button-secondary:hover,
.job-sheet-page .sheet-list-toolbar button:hover,
.job-sheet-page .sheet-record-actions button:hover {
  background: var(--js-hover);
  border-color: rgba(109, 165, 149, .38);
}

.job-sheet-page .job-sheet-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  margin: 0;
  padding: 4px;
  background: rgba(237, 248, 250, .7);
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 10px;
}

.job-sheet-page .job-sheet-tabs button {
  min-height: 38px;
  padding: 7px 13px;
  color: var(--js-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}

.job-sheet-page .job-sheet-tabs button:hover {
  color: var(--js-forest);
  background: rgba(255, 255, 255, .52);
}

.job-sheet-page .job-sheet-tabs button[aria-pressed="true"] {
  color: var(--js-forest);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 1px 3px rgba(31, 65, 76, .08);
}

.job-sheet-page .job-sheet-form {
  display: grid;
  gap: 14px;
}

.job-sheet-page .job-sheet-card,
.job-sheet-page [data-sheet-workspace]:not([hidden]) {
  min-width: 0;
  margin: 0;
  padding: 0 16px 16px;
  overflow: visible;
  background: var(--js-surface);
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(43, 75, 92, .055);
  backdrop-filter: blur(14px) saturate(112%);
}

.job-sheet-page .job-sheet-card > header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 60px;
  margin: 0 -16px 14px;
  padding: 10px 16px;
  background: rgba(248, 252, 255, .44);
  border-bottom: 1px solid var(--js-line);
  border-radius: 14px 14px 0 0;
}

.job-sheet-page .job-sheet-card > header > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  color: white;
  background: linear-gradient(145deg, #087d60, #075742);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 9px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .2);
  font-size: 11px;
  font-weight: 700;
}

.job-sheet-page .job-sheet-card > header h2 {
  margin: 0;
  color: var(--js-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.job-sheet-page .job-sheet-card > header p {
  margin: 2px 0 0;
  color: var(--js-muted);
  font-size: 12px;
  line-height: 1.4;
}

.job-sheet-page .job-sheet-google {
  position: relative;
  margin: 0 0 14px;
  padding: 12px;
  background: rgba(234, 248, 244, .7);
  border: 1px solid rgba(185, 222, 211, .82);
  border-radius: 10px;
}

.job-sheet-page .job-sheet-google label,
.job-sheet-page .job-sheet-field {
  display: grid;
  gap: 5px;
}

.job-sheet-page .job-sheet-google label > span,
.job-sheet-page .job-sheet-field > span {
  color: #355e55;
  font-size: 12px;
  font-weight: 600;
}

.job-sheet-page .job-sheet-google input,
.job-sheet-page .job-sheet-field input,
.job-sheet-page .job-sheet-field select,
.job-sheet-page .job-sheet-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--js-ink);
  background: rgba(255, 255, 255, .9);
  border: 1px solid #ccd8d4;
  border-radius: 8px;
  box-shadow: none;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.job-sheet-page .job-sheet-field textarea {
  min-height: 76px;
  line-height: 1.5;
  resize: vertical;
}

.job-sheet-page .job-sheet-google input:focus,
.job-sheet-page .job-sheet-field input:focus,
.job-sheet-page .job-sheet-field select:focus,
.job-sheet-page .job-sheet-field textarea:focus {
  background: white;
  border-color: #168d6b;
  box-shadow: 0 0 0 3px rgba(22, 141, 107, .1);
}

.job-sheet-page .job-sheet-google > p {
  margin: 6px 0 0;
  color: var(--js-muted);
  font-size: 11px;
}

.job-sheet-page .job-sheet-google-results {
  top: 66px;
  right: 12px;
  left: 12px;
  max-height: 260px;
  overflow: auto;
  background: white;
  border: 1px solid #cbdad4;
  border-radius: 9px;
  box-shadow: 0 16px 38px rgba(28, 65, 72, .16);
}

.job-sheet-page .job-sheet-google-results button,
.job-sheet-page .job-sheet-google-results > div {
  padding: 9px 11px;
  color: var(--js-ink);
  background: white;
  border: 0;
  border-bottom: 1px solid #e5ece8;
}

.job-sheet-page .job-sheet-google-results button:hover {
  background: var(--js-hover);
}

.job-sheet-page .job-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.job-sheet-page .job-sheet-grid--visit {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.job-sheet-page .job-sheet-field--wide {
  grid-column: 1 / -1;
}

.job-sheet-page .job-sheet-duration {
  margin: 12px 0 0;
  padding: 8px 10px;
  color: #256652;
  background: rgba(230, 245, 238, .84);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
}

.job-sheet-page .job-sheet-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0 0;
  padding: 10px 11px;
  color: var(--js-muted);
  background: rgba(244, 249, 247, .72);
  border: 1px solid #d5e4df;
  border-radius: 9px;
  font-size: 12px;
}

.job-sheet-page .job-sheet-check--confirmation {
  color: #715312;
  background: rgba(255, 248, 226, .76);
  border-color: #ead89f;
}

.job-sheet-page .job-sheet-check input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 1px 0 0;
  accent-color: var(--js-forest);
}

.job-sheet-page .job-sheet-check span {
  display: grid;
  gap: 1px;
  color: inherit;
  font-size: 12px;
}

.job-sheet-page .job-sheet-check strong {
  color: var(--js-ink);
  font-size: 12px;
  font-weight: 600;
}

.job-sheet-page .job-sheet-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.job-sheet-page .job-sheet-signature-grid > div {
  padding: 11px;
  background: rgba(247, 251, 249, .72);
  border: 1px solid #d7e3df;
  border-radius: 10px;
}

.job-sheet-page .job-sheet-signature-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 7px;
}

.job-sheet-page .job-sheet-signature-heading strong {
  color: var(--js-ink);
  font-size: 12px;
  font-weight: 600;
}

.job-sheet-page .job-sheet-signature-heading button {
  padding: 3px 6px;
  color: var(--js-forest);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.job-sheet-page .job-sheet-signature-heading button:hover {
  background: var(--js-hover);
}

.job-sheet-page .job-sheet-signature-grid canvas {
  display: block;
  width: 100%;
  height: 120px;
  background: rgba(255, 255, 255, .94);
  border: 1px dashed #9ebbb1;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
}

.job-sheet-page .job-sheet-signature-grid small {
  display: block;
  margin: 5px 0 0;
  color: var(--js-muted);
  font-size: 10px;
}

.job-sheet-page .job-sheet-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, auto) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  color: var(--js-ink);
  background: linear-gradient(110deg, rgba(230, 245, 239, .86), rgba(239, 245, 255, .78));
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 13px;
  box-shadow: 0 8px 22px rgba(43, 75, 92, .055);
}

.job-sheet-page .job-sheet-footer > div {
  display: grid;
  gap: 2px;
}

.job-sheet-page .job-sheet-footer > div strong {
  font-size: 13px;
  font-weight: 600;
}

.job-sheet-page .job-sheet-footer > div span {
  color: var(--js-muted);
  font-size: 11px;
}

.job-sheet-page .job-sheet-footer .button-primary {
  min-height: 40px;
  padding: 8px 13px;
  color: white;
  background: var(--js-forest);
  border: 1px solid var(--js-forest);
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}

.job-sheet-page .job-sheet-footer .button-primary:hover {
  background: #104a35;
}

.job-sheet-page .job-sheet-message {
  margin: 0;
  color: var(--js-muted);
  font-size: 11px;
  text-align: right;
}

.job-sheet-page .job-sheet-message.is-success { color: var(--js-forest); }
.job-sheet-page .job-sheet-message.is-error { color: #b23448; }

.job-sheet-page [data-sheet-workspace]:not([hidden]) {
  display: block;
  padding: 15px;
}

.job-sheet-page .sheet-list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 42px;
  margin: 0 0 12px;
}

.job-sheet-page .sheet-list-toolbar:last-child {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--js-line);
}

.job-sheet-page .sheet-list-toolbar h2 {
  flex: 1;
  margin: 0;
  color: var(--js-ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.job-sheet-page .sheet-list-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--js-muted);
  font-size: 12px;
}

.job-sheet-page .sheet-list-toolbar select {
  min-height: 38px;
  padding: 7px 9px;
  color: var(--js-ink);
  background: white;
  border: 1px solid #ccd8d4;
  border-radius: 8px;
}

.job-sheet-page .sheet-records {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  margin: 0;
}

.job-sheet-page .sheet-records article {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--js-line);
  border-radius: 10px;
  box-shadow: none;
}

.job-sheet-page .sheet-records header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.job-sheet-page .sheet-records header strong {
  color: var(--js-ink);
  font-size: 14px;
  font-weight: 600;
}

.job-sheet-page .sheet-records header span,
.job-sheet-page .sheet-records p {
  color: var(--js-muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.job-sheet-page .sheet-email-state {
  padding: 6px 8px;
  color: #79500e;
  background: #fff5e5;
  border-radius: 6px;
}

.job-sheet-page .sheet-email-state.state-sent { color: var(--js-forest); background: #e5f6ef; }
.job-sheet-page .sheet-email-state.state-failed,
.job-sheet-page .sheet-email-state.state-uncertain { color: #a83245; background: #fff0f2; }

.job-sheet-page .sheet-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.job-sheet-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: 88dvh;
  padding: 18px;
  overflow: auto;
  color: var(--sh-ink, #0b2945);
  background: rgba(251, 253, 253, .98);
  border: 1px solid #cbdad4;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(14, 50, 61, .24);
}

.job-sheet-dialog::backdrop {
  background: rgba(3, 32, 43, .58);
  backdrop-filter: blur(3px);
}

.job-sheet-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--sh-line, #d7e3e3);
}

.job-sheet-dialog h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.job-sheet-dialog label {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  color: var(--sh-muted, #526f88);
  font-size: 12px;
}

.job-sheet-dialog input:not([type="checkbox"]),
.job-sheet-dialog select,
.job-sheet-dialog textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--sh-ink, #0b2945);
  background: white;
  border: 1px solid #ccd8d4;
  border-radius: 8px;
}

.job-sheet-dialog button {
  min-height: 38px;
  padding: 7px 11px;
  color: var(--sh-forest, #087859);
  background: white;
  border: 1px solid #cbdad4;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 1000px) {
  .job-sheet-page .job-sheet-grid--visit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .job-sheet-page .job-sheet-footer {
    grid-template-columns: 1fr auto;
  }

  .job-sheet-page .job-sheet-message {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
  }
}

@media (max-width: 700px) {
  .job-sheet-page .job-sheet-hero {
    flex-direction: column;
    min-height: 0;
  }

  .job-sheet-page .job-sheet-hero-actions {
    width: 100%;
    justify-content: space-between;
    padding-top: 0;
  }

  .job-sheet-page .job-sheet-tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .job-sheet-page .job-sheet-grid,
  .job-sheet-page .job-sheet-grid--visit,
  .job-sheet-page .job-sheet-signature-grid {
    grid-template-columns: 1fr;
  }

  .job-sheet-page .job-sheet-footer {
    grid-template-columns: 1fr;
  }

  .job-sheet-page .job-sheet-message {
    grid-column: auto;
    grid-row: auto;
  }

  .job-sheet-page .job-sheet-footer .button-primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .job-sheet-page *,
  .job-sheet-dialog * {
    transition-duration: 0s;
  }
}

@media print {
  .job-sheet-page .job-sheet-card {
    background: white;
    border-color: #d7e3df;
    box-shadow: none;
    backdrop-filter: none;
  }
}
