/*
Title: App
Role: Style the engineering work-pack workspace, secondary setup, accessible navigation, forms and tables.
Index:
  S01 - Base colors and typography
  S02 - Full-width workspace
  S03 - Content layout
  S04 - Notices and cards
  S05 - Accessible navigation and errors
  S06 - Responsive layout
  S07 - Employee access forms
  S08 - Record forms
  S09 - Toolbars and tables
  S10 - Register filters and report summaries
  S11 - Guided setup and entry feedback
  S12 - Focused customer workspace
  S13 - Engineering work-pack workspace
*/

/* [S01] Base colors and typography */
:root {
  font-family: var(--brand-font);
  color: var(--ink);
  background: var(--surface-page);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--brand-blue);
}
/* [S02] Full-width workspace */
.shell {
  min-height: 100vh;
}
/* [S03] Content layout */
main {
  flex: 1;
  min-width: 0;
}
.pill {
  background: var(--surface-soft);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
}
.content {
  padding: 44px 36px 140px;
  max-width: 1440px;
  margin-inline: auto;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
}
h1 {
  margin: 12px 0;
  font-size: 36px;
}
.lead {
  font-size: 18px;
  color: var(--text-muted);
}
/* [S04] Notices and cards */
.notice {
  padding: 20px 24px;
  margin: 28px 0;
  border-left: 4px solid var(--warning);
  background: var(--warning-surface);
  border-radius: 8px;
  line-height: 1.6;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
article {
  background: var(--surface);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
article p {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
/* [S05] Accessible navigation and errors */
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--surface);
  padding: 12px;
  z-index: 10;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
#blazor-error-ui {
  display: none;
  background: var(--warning-surface);
  bottom: 0;
  left: 0;
  position: fixed;
  width: 100%;
  padding: 18px;
}
/* [S06] Responsive layout */
@media (max-width: 760px) {
  .content {
    padding: 24px 16px 120px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 28px;
  }
}
/* Employee access uses the browser's same-origin HttpOnly session cookie. */
/* [S07] Employee access forms */
.access-form {
  max-width: 32rem;
  display: grid;
  gap: 1rem;
}
.access-form label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
}
.access-form input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--control-line);
  border-radius: 0.4rem;
  font: inherit;
}
.access-form button {
  padding: 0.8rem 1rem;
  background: var(--brand-blue);
  color: white;
  border: 0;
  border-radius: 0.4rem;
  font: inherit;
  cursor: pointer;
}
.access-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}
/* [S08] Record forms */
.register-section {
  margin-top: 2.5rem;
}
.record-form {
  display: grid;
  gap: 1rem;
  max-width: 44rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}
.record-form label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
}
.record-form input,
.record-form textarea,
.record-form select {
  width: 100%;
  padding: 0.7rem;
  font: inherit;
  border: 1px solid var(--control-line);
  border-radius: 0.4rem;
}
.record-form textarea {
  min-height: 5rem;
}
.record-form fieldset {
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--line);
  padding: 1rem;
}
.record-form .checkbox-label {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-weight: 400;
}
.record-form .checkbox-label input {
  width: auto;
}
.source-selectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  max-width: 44rem;
  margin: 1.5rem 0;
}
.source-selectors label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
}
.source-selectors select {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem;
  font: inherit;
  border: 1px solid var(--control-line);
  border-radius: 0.4rem;
  background: var(--surface);
}
button {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--control-line);
  border-radius: 0.4rem;
  background: var(--surface);
  color: var(--brand-blue);
  font: inherit;
  cursor: pointer;
}
button[type="submit"] {
  background: var(--brand-blue);
  color: white;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
/* [S09] Toolbars and tables */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
th,
td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--surface-soft);
}
.document-history {
  min-width: 44rem;
  table-layout: fixed;
}
.document-history td {
  vertical-align: top;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.document-history details {
  margin-top: 0.6rem;
}
.document-history summary {
  cursor: pointer;
}
/* [S10] Register filters and report summaries */
.register-filters {
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.register-filters .toolbar {
  grid-column: 1 / -1;
}
.register-filters input[type="checkbox"] {
  width: auto;
  justify-self: start;
}
.register-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-left: 1.2rem;
}
.register-detail {
  min-width: 220px;
  max-width: 400px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.applied-filters {
  overflow-wrap: anywhere;
}
caption {
  text-align: left;
  font-weight: 600;
  padding: 0.7rem 0;
}
/* [S11] Guided setup and entry feedback */
.workflow-guide {
  margin: 1.5rem 0 2rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface-tint);
  line-height: 1.6;
}
.workflow-guide p:last-child {
  margin-bottom: 0;
}
.workflow-guide summary {
  font-weight: 600;
  cursor: pointer;
}
.workflow-guide li + li {
  margin-top: 0.5rem;
}
.workflow-steps {
  list-style: none;
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 1.5rem 0;
}
.workflow-steps > li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
}
.workflow-steps h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}
.workflow-steps p {
  margin: 0 0 0.7rem;
  line-height: 1.6;
}
.step-number {
  display: grid;
  place-items: center;
  flex: 0 0 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  font-weight: 700;
}
.action-link {
  display: inline-block;
  padding: 0.8rem 1rem;
  background: var(--brand-blue);
  color: white;
  border-radius: 0.4rem;
  font-weight: 600;
  text-decoration: none;
}
.action-link:hover {
  background: var(--brand-blue-hover);
  text-decoration: underline;
}
.section-links a {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
}
.register-section {
  scroll-margin-top: 1rem;
}
.record-form small,
.field-help {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted);
}
.record-form h2,
.record-form h3 {
  margin: 0;
}
.empty-state {
  padding: 1rem;
  border: 1px dashed var(--control-line);
  border-radius: 0.4rem;
  background: var(--surface-tint);
  line-height: 1.6;
}
.success-notice {
  padding: 1rem;
  border-left: 4px solid var(--success);
  background: var(--success-surface);
  border-radius: 0.4rem;
  line-height: 1.6;
}
@media (max-width: 480px) {
  .workflow-steps > li {
    padding: 1rem;
    gap: 0.7rem;
  }
  .workflow-guide {
    padding: 1rem;
  }
  .record-form {
    padding: 1rem;
  }
}

/* [S12] Focused customer workspace */
.record-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.record-steps a {
  display: inline-block;
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  color: var(--text-muted);
  background: var(--surface);
  text-decoration: none;
  border: 1px solid var(--line);
}
.record-steps a[aria-current="page"] {
  color: white;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  font-weight: 600;
}
.record-purpose {
  max-width: 52rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.customer-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 1.5rem;
}
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.section-heading h2,
.section-heading h3 {
  margin: 0;
  overflow-wrap: anywhere;
}
.record-count {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.2rem 0.5rem;
  background: var(--surface-soft);
  border-radius: 1rem;
  font-size: 0.85rem;
  vertical-align: middle;
}
.customer-search {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.search-input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--control-line);
  border-radius: 0.4rem;
  font: inherit;
}
.customer-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.customer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 1.2rem;
  overflow-wrap: anywhere;
}
.customer-card.saved {
  border-left: 4px solid var(--success);
}
.customer-card h3 {
  font-size: 1.05rem;
  flex: 1;
}
.customer-card p {
  margin: 0.5rem 0;
  color: var(--text-muted);
  line-height: 1.5;
}
.customer-card summary {
  cursor: pointer;
  margin-top: 0.75rem;
  color: var(--brand-blue);
}
.customer-address {
  white-space: pre-wrap;
}
.saved-label {
  display: inline-block;
  color: var(--success);
  background: var(--success-surface);
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 0.3rem;
}
.customer-editor {
  margin: 0;
  width: 100%;
  max-width: none;
  scroll-margin-top: 1rem;
}
.customer-editor fieldset {
  min-width: 0;
}
.customer-editor label {
  display: block;
}
.customer-editor label input {
  margin-top: 0.4rem;
}
.customer-editor legend {
  font-weight: 600;
}
.customer-editor h3 {
  font-size: 1rem;
}
.customer-editor input,
.customer-editor textarea {
  min-width: 0;
}
.optional-label,
.required-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 400;
  margin-left: 0.25rem;
}
.optional-label {
  color: var(--text-muted);
}
.required-label {
  color: var(--error);
}
.add-contact {
  justify-self: start;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.draft-notice {
  padding: 0.8rem 1rem;
  background: var(--warning-surface);
  border-left: 3px solid var(--warning);
  line-height: 1.5;
  font-size: 0.9rem;
}
.record-next {
  margin-top: 2rem;
  padding: 1.3rem;
  border-radius: 0.6rem;
  background: var(--surface-soft);
  line-height: 1.6;
}
@media (max-width: 1100px) {
  .customer-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* [S13] Engineering work-pack workspace */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.pack-filters {
  display: grid;
  gap: 0.5rem;
  max-width: 38rem;
  margin: 1.8rem 0 0.8rem;
}
.pack-filters label {
  font-weight: 600;
}
.pack-filters input {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1rem;
  font: inherit;
  border: 1px solid var(--control-line);
  border-radius: 0.5rem;
}
.work-pack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 1.2rem 0 2rem;
}
.work-pack-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.5rem;
  overflow-wrap: anywhere;
}
.pack-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.work-pack-card h2 {
  margin: 0;
  font-size: 1.4rem;
}
.work-pack-card .pack-due {
  margin-top: auto;
  font-size: 0.9rem;
}
.work-pack-card .action-link {
  align-self: flex-start;
}
.pack-overview {
  padding: 1.5rem;
  margin: 1.6rem 0 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.pack-aircraft {
  font-size: 1.5rem;
}
.pack-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.3rem;
  margin: 1.5rem 0 0;
}
.pack-facts dt {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}
.pack-facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.pack-description {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-bottom: 0;
  white-space: pre-wrap;
}
.pack-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.pack-action {
  display: grid;
  gap: 0.6rem;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  text-decoration: none;
}
.pack-action strong {
  font-size: 1.1rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.pack-action span {
  color: var(--text-muted);
  line-height: 1.5;
}
.primary-pack-action {
  grid-column: 1 / -1;
  background: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
}
.primary-pack-action span {
  color: var(--night-text);
}
.pack-action:hover {
  box-shadow: 0 3px 12px #17233d20;
}
.work-pack-context {
  padding: 0.9rem 1.1rem;
  background: var(--surface-soft);
  border-radius: 0.5rem;
  line-height: 1.6;
}
@media (max-width: 900px) {
  .work-pack-grid {
    grid-template-columns: 1fr;
  }
  .pack-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .pack-facts,
  .pack-actions {
    grid-template-columns: 1fr;
  }
  .pack-overview,
  .work-pack-card,
  .pack-action {
    padding: 1.1rem;
  }
}
