:root {
  color-scheme: light;
  --ink: #15202b;
  --muted: #627080;
  --line: #d9e1e8;
  --soft: #f5f7f9;
  --panel: #ffffff;
  --brand: #176b87;
  --brand-2: #d34f2f;
  --ok: #18794e;
  --warn: #9a5b00;
  --danger: #b42318;
  --focus: #84c5dc;
  --shadow: 0 14px 36px rgba(19, 32, 43, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f6f8fa;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(217, 225, 232, 0.75);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 36px;
  border-radius: 8px;
  background: #102a3a;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.brand-title {
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 18px 0 30px;
}

.home-hero {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}

.hero h1,
.section-title {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  max-width: 680px;
}

.lead {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  margin: 18px 0 0;
  max-width: 660px;
}

.eyebrow {
  width: fit-content;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: #3c4856;
  font-size: 12px;
  font-weight: 800;
}

.lookup-panel {
  max-width: 620px;
  margin-top: 26px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.process-panel {
  display: grid;
  gap: 12px;
}

.process-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.process-step p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.step-number,
.action-index {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 8px;
  background: #eef6f8;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.panel,
.card,
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.compact-panel {
  max-width: 560px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.label {
  font-weight: 700;
  font-size: 13px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.textarea {
  min-height: 104px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: 3px solid var(--focus);
  border-color: var(--brand);
}

.btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.28);
}

.btn.icon {
  width: 42px;
  padding: 0;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.error,
.success,
.notice {
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid;
}

.error {
  background: #fff5f4;
  border-color: #f1b7b0;
  color: var(--danger);
}

.success {
  background: #eefbf4;
  border-color: #a8dfbf;
  color: var(--ok);
}

.notice {
  background: #fff8e8;
  border-color: #efd08b;
  color: var(--warn);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(26px, 4vw, 42px);
}

.manual-open {
  overflow: hidden;
}

.manual-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #f6f8fa;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.manual-overlay-bar {
  flex: 0 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  z-index: 2;
}

.manual-overlay-back {
  min-width: 96px;
}

.manual-overlay-title {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-overlay-viewer {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  background: #eef2f6;
}

.manual-loading,
.manual-fallback {
  display: grid;
  place-items: center;
  min-height: 45vh;
  padding: 24px;
  text-align: center;
}

.manual-pages {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: 100%;
}

.manual-page {
  width: min(1120px, calc(100% - 24px));
  min-height: 62vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.manual-page-placeholder {
  color: var(--muted);
  font-size: 14px;
}

.manual-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  padding: 18px;
}

.action-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) repeat(2, minmax(220px, 0.9fr));
  gap: 16px;
}

.action-grid.two-actions {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.action-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 230px;
}

.action-card h2 {
  margin: 0;
}

.primary-action {
  border-color: rgba(23, 107, 135, 0.35);
}

.stat {
  display: grid;
  gap: 8px;
}

.stat strong {
  font-size: 28px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
}

.lookup-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  margin-bottom: 0;
  width: 100%;
}

.lookup-submit,
.scan-cta {
  width: 100%;
}

.scan-cta {
  min-height: 48px;
  min-width: 0;
  font-size: 18px;
}

.captcha-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.captcha-row {
  display: grid;
}

.captcha-question {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef3f6;
  color: #435160;
  font-size: 13px;
  font-weight: 800;
}

.text-button {
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  font-weight: 750;
}

.tab.active {
  border-color: var(--brand);
  background: rgba(23, 107, 135, 0.1);
  color: var(--brand);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-module {
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(21, 32, 43, 0.05);
  padding: 20px;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.workspace-head h2 {
  margin: 6px 0 6px;
  font-size: 22px;
  line-height: 1.2;
}

.workspace-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.workspace-stat {
  border: 1px solid #dfe7ed;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f9fbfc;
}

.workspace-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workspace-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
}

.workspace-stat.warn {
  border-color: #f0d29a;
  background: #fff8ec;
}

.workspace-stat.ok {
  border-color: #b9dfca;
  background: #f0fbf5;
}

.workspace-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
}

.compact-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.compact-field .input {
  min-width: 190px;
}

.import-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.import-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 130px minmax(220px, 0.8fr) 128px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.import-row:last-child {
  border-bottom: 0;
}

.import-row strong {
  display: block;
  margin-bottom: 4px;
}

.import-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.small-btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: var(--soft);
  color: #3c4856;
}

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.replacement-parts-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.part-card {
  min-height: 256px;
  display: grid;
  grid-template-rows: 132px auto;
  overflow: hidden;
}

.part-image {
  width: 100%;
  height: 132px;
  object-fit: contain;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.replacement-part-card {
  min-height: 188px;
  grid-template-rows: 74px auto;
}

.replacement-part-card .part-image {
  height: 74px;
}

.replacement-part-card .part-body {
  padding: 9px;
  gap: 4px;
  font-size: 13px;
}

.replacement-part-card .pill {
  padding: 3px 7px;
  font-size: 11px;
}

.part-body {
  padding: 13px;
  display: grid;
  gap: 6px;
}

.qty-control {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 8px;
  align-items: center;
}

.replacement-part-card .qty-control {
  grid-template-columns: 30px 1fr 30px;
  gap: 5px;
}

.replacement-part-card .btn.icon {
  width: 30px;
  min-height: 32px;
}

.replacement-part-card .input {
  min-height: 32px;
  padding: 6px 8px;
  text-align: center;
}

.parts-toolbar,
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}

.pager {
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--soft);
  color: #3c4856;
  font-size: 12px;
  font-weight: 700;
}

.pill.warn {
  background: #fff0cf;
  color: #8a4d00;
}

.pill.ok {
  background: #def7e9;
  color: #146c43;
}

.split {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side-nav {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 88px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 32, 43, 0.42);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 18px;
}

.modal {
  width: min(760px, 100%);
  max-height: min(760px, 90vh);
  overflow: auto;
  padding: 22px;
}

.video-box {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 820px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .action-grid,
  .filter-panel,
  .summary-strip,
  .import-row {
    grid-template-columns: 1fr;
  }

  .workspace-head,
  .workspace-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
  }

  .process-panel {
    order: -1;
  }

  .side-nav {
    position: static;
  }
}

@media (max-width: 560px) {
  .manual-overlay-bar {
    min-height: 52px;
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .manual-overlay-back {
    min-width: 82px;
    min-height: 38px;
    padding: 7px 10px;
    font-size: 14px;
  }

  .manual-overlay-title {
    font-size: 13px;
  }

  .manual-overlay-viewer {
    padding-top: 8px;
  }

  .manual-pages {
    gap: 10px;
  }

  .manual-page {
    width: calc(100% - 16px);
    min-height: 56vh;
    box-shadow: none;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px 14px;
  }

  .brand {
    width: 100%;
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 32px;
    font-size: 11px;
  }

  .brand-title {
    white-space: normal;
    font-size: 15px;
    line-height: 1.2;
  }

  .brand-subtitle {
    display: none;
  }

  .top-actions {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }

  .top-actions .select {
    width: 100%;
    min-height: 40px;
  }

  .page {
    width: min(1180px, calc(100% - 24px));
    padding: 18px 0 48px;
  }

  .section-head {
    display: grid;
    align-items: start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .section-head .btn {
    width: 100%;
  }

  .section-title {
    font-size: 26px;
    line-height: 1.12;
  }

  .lead {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.45;
  }

  .action-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .action-grid.two-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .action-card {
    min-height: auto;
    padding: 14px;
    gap: 10px;
  }

  .action-card h2 {
    font-size: 18px;
    line-height: 1.25;
  }

  .action-card .btn {
    width: 100%;
  }

  .action-index {
    width: 30px;
    height: 26px;
  }

  .captcha-label-row {
    flex-wrap: wrap;
  }

  .btn,
  .select {
    min-width: 0;
  }
}
