:root {
  color-scheme: light;
  --ink: #172331;
  --muted: #5c6b78;
  --surface: #ffffff;
  --canvas: #f2f5f7;
  --brand: #116b78;
  --brand-dark: #0c4e58;
  --line: #d8e0e5;
  --focus: #e58d12;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: var(--brand-dark); }
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; padding: .7rem 1rem; background: white; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3rem); color: white; background: #132a37; }
.brand { display: flex; gap: .45rem; align-items: center; color: white; font-size: 1.15rem; text-decoration: none; }
.brand-mark { padding: .3rem .45rem; font-weight: 800; color: #132a37; background: #66d2dd; border-radius: .25rem; }
.account { display: flex; align-items: center; gap: 1rem; }
.account form { margin: 0; }
.link-button { padding: 0; color: white; background: transparent; border: 0; text-decoration: underline; cursor: pointer; }
.main-nav { display: flex; gap: .25rem; padding: .6rem clamp(1rem, 4vw, 3rem); overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line); }
.main-nav a { padding: .65rem .8rem; color: var(--ink); text-decoration: none; border-radius: .35rem; white-space: nowrap; }
.main-nav a:hover { background: #e8f2f4; }
.main-nav a[aria-current="page"] { color: white; background: var(--brand); }
.content { width: min(72rem, calc(100% - 2rem)); margin: 2.5rem auto; }
h1 { margin: .2rem 0 1rem; font-size: clamp(2rem, 5vw, 3rem); }
.eyebrow { margin: 0; color: var(--brand-dark); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lead { color: var(--muted); font-size: 1.1rem; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.module-grid a { display: flex; min-height: 8rem; flex-direction: column; justify-content: space-between; padding: 1.2rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; text-decoration: none; box-shadow: 0 .2rem .8rem rgb(23 35 49 / 6%); }
.module-grid a:hover { border-color: var(--brand); transform: translateY(-1px); }
.module-grid span { color: var(--muted); font-size: .9rem; }
.notice, .login-card { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; }
.notice { max-width: 48rem; }
.notice p { margin-bottom: 0; color: var(--muted); }
.login-card { width: min(28rem, 100%); margin: 5vh auto; }
.field { display: grid; gap: .35rem; margin: 1rem 0; }
.field label { font-weight: 700; }
.field input { width: 100%; padding: .72rem; font: inherit; border: 1px solid #9dacb8; border-radius: .3rem; }
.primary-button { width: 100%; margin-top: .5rem; padding: .8rem 1rem; color: white; font: inherit; font-weight: 700; background: var(--brand); border: 0; border-radius: .3rem; cursor: pointer; }
.error { padding: .7rem; color: #7b1720; background: #fff0f1; border-left: .25rem solid #b32431; }
:focus-visible { outline: .2rem solid var(--focus); outline-offset: .15rem; }

@media (max-width: 42rem) {
  .site-header { align-items: flex-start; }
  .account { align-items: flex-end; flex-direction: column; gap: .25rem; }
  .content { margin-top: 1.5rem; }
}

.subnav { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 2rem; }
.subnav a { padding: .55rem .7rem; background: var(--surface); border: 1px solid var(--line); border-radius: .3rem; text-decoration: none; }
.subnav a:hover { border-color: var(--brand); }
.page-actions { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.primary-link { padding: .65rem .9rem; color: white; background: var(--brand); border-radius: .3rem; text-decoration: none; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: .45rem; }
.compact-table { width: 100%; border-collapse: collapse; }
.compact-table th, .compact-table td { padding: .7rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.compact-table th { background: #e8eef1; white-space: nowrap; }
.compact-table tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; align-items: center; gap: .8rem; white-space: nowrap; }
.row-actions form { margin: 0; }
.link-button.dark { color: var(--brand-dark); }
.status { display: inline-block; padding: .2rem .45rem; color: #175d31; background: #e6f5eb; border-radius: 1rem; font-size: .82rem; }
.status-inactive { color: #5d6165; background: #e9ecef; }
.settings-form { width: min(40rem, 100%); padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; }
.settings-form select, .settings-form textarea { width: 100%; padding: .72rem; font: inherit; border: 1px solid #9dacb8; border-radius: .3rem; }
.settings-form input[type="checkbox"] { width: auto; }
.settings-form .errorlist { margin: .25rem 0 0; padding-left: 1.2rem; color: #8d1b25; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.primary-button.fit { width: auto; }
.notice.warning { margin-bottom: 1rem; border-left: .3rem solid var(--focus); }
.compact-table code { white-space: normal; overflow-wrap: anywhere; }
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.title-row h1, .title-row h2 { margin-top: 0; }
.search-bar { display: flex; align-items: flex-end; gap: 1rem; margin: 1.25rem 0 .75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: .45rem; }
.search-bar .field { margin: 0; }
.grow { flex: 1 1 24rem; }
.check-field { display: flex; align-items: center; gap: .45rem; min-height: 2.7rem; white-space: nowrap; }
.result-note { margin: .5rem 0 1rem; color: var(--muted); font-size: .9rem; }
.status-warning { color: #7a4a00; background: #fff0d5; }
.compact-actions { align-items: center; flex-wrap: wrap; margin: 0; }
.compact-actions form { margin: 0; }
.secondary-button { padding: .55rem .75rem; color: var(--brand-dark); font: inherit; background: var(--surface); border: 1px solid var(--brand); border-radius: .3rem; cursor: pointer; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.detail-card { padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: .45rem; }
.detail-card h2 { margin-top: 0; }
.detail-card dl { display: grid; grid-template-columns: minmax(6rem, auto) 1fr; gap: .65rem 1rem; margin-bottom: 0; }
.detail-card dt { color: var(--muted); font-weight: 700; }
.detail-card dd { margin: 0; }
.readiness-card { border-left: .3rem solid #2f7d4c; }
.readiness-card.incomplete { border-left-color: var(--focus); }
.pre-line { white-space: pre-line; }
.section-block { margin-top: 2rem; }
.subsection-title { align-items: center; }

@media (max-width: 48rem) {
  .title-row, .search-bar { align-items: stretch; flex-direction: column; }
  .grow { flex-basis: auto; width: 100%; }
  .compact-actions { align-items: flex-start; }
}
.secondary-link { display: inline-block; padding: .55rem .75rem; color: var(--brand-dark); background: var(--surface); border: 1px solid var(--brand); border-radius: .3rem; text-decoration: none; }
.storage-actions, .customer-filter { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .7rem; }
.storage-actions form { margin: 0; }
.customer-filter { margin: 1rem 0; }
.customer-filter .field { margin: 0; }
.settings-form input[type="text"], .settings-form select, .settings-form textarea { width: 100%; padding: .72rem; font: inherit; border: 1px solid #9dacb8; border-radius: .3rem; }
.status-error { color: #7b1720; background: #fff0f1; }
.messages { margin-bottom: 1rem; }
.message { padding: .7rem 1rem; background: white; border-left: .25rem solid var(--brand); }
.message.error { border-left-color: #b32431; }
.message.warning { border-left-color: #b57a00; }
.link-button.danger, .missing-value, .warning-text { color: #8d1b25; }
.incomplete-row { background: #fff8ec; }
.bom-table { margin-top: 1rem; }
.detail-card.incomplete { border-left: .3rem solid var(--focus); }
.path-code { overflow-wrap: anywhere; }
.project-identity { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.path-warning { margin-bottom: 1rem; }
