:root {
  color-scheme: light;
  --ink: #18201f;
  --muted: #67716f;
  --line: #d9d6cc;
  --paper: #f6f4ee;
  --panel: #ffffff;
  --deep: #163b3b;
  --blue: #235b7a;
  --mint: #d9eadf;
  --amber: #b26b15;
  --amber-soft: #fff1d8;
  --red: #a43732;
  --red-soft: #f9dedb;
  --green: #24724f;
  --green-soft: #dcefe5;
  --shadow: 0 16px 44px rgb(22 59 59 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  background:
    linear-gradient(110deg, rgb(22 59 59 / 88%), rgb(35 91 122 / 78%)),
    url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=1600&q=80") center / cover;
}

.login-intro {
  display: flex;
  min-height: 520px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
  color: white;
}

.login-intro h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 0.95;
}

.login-intro p {
  max-width: 610px;
  margin: 22px 0 0;
  color: rgb(255 255 255 / 86%);
  font-size: 20px;
  line-height: 1.45;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(246 244 238 / 94%);
}

.login-form {
  width: 100%;
  max-width: 380px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-form h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.field span,
.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(35 91 122 / 15%);
}

.demo-logins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.demo-logins button,
.ghost-button,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.primary-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  font-weight: 800;
}

.primary-button {
  background: var(--deep);
}

.danger-button {
  background: var(--red);
}

.workspace {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgb(246 244 238 / 94%);
  padding: 10px 22px;
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--deep);
  color: white;
  font-weight: 900;
}

.brand-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

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

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.sync-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.sync-pill.online {
  background: var(--green-soft);
  color: var(--green);
}

.sync-pill.offline {
  background: var(--amber-soft);
  color: var(--amber);
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 20px;
}

.tab {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  border-color: var(--deep);
  background: var(--mint);
  color: var(--deep);
}

.view {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 20px;
}

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

.picker-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.compact-field {
  margin: 0;
}

.warehouse-board {
  display: grid;
  gap: 14px;
}

.work-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.work-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.scan-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.scanner-dock {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, auto);
  gap: 10px;
}

.scan-button {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: var(--deep);
  color: white;
  font-size: 18px;
  font-weight: 900;
}

.scan-button.active {
  background: var(--red);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgb(24 32 31 / 6%);
}

.panel-header,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.panel-header h2,
.section-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 16px;
}

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

.scan-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.manual-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 10px;
}

.camera {
  position: relative;
  display: none;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1c1b;
}

.camera.active {
  display: block;
}

.camera video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  inset: 12%;
  display: grid;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 78%);
  border-radius: 8px;
  pointer-events: none;
}

.scan-frame span {
  width: 88%;
  height: 2px;
  background: #e64e43;
  box-shadow: 0 0 14px rgb(230 78 67 / 70%);
}

.status-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

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

.metric {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf7;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.qty-input {
  width: 84px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.ok {
  background: var(--green-soft);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.block {
  background: var(--red-soft);
  color: var(--red);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.comments {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.comment {
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
  padding: 10px 12px;
  color: #4d3416;
}

.quick-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.scan-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 0.9fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.scan-line h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.scan-line p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.line-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.line-facts span,
.line-facts label {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.line-facts strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
}

.marking-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 10px;
}

.marking-code-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  overflow-wrap: anywhere;
}

.log-panel {
  margin-top: 6px;
}

.log-row {
  display: grid;
  grid-template-columns: 150px 150px minmax(180px, 1fr) 130px 170px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.log-row strong {
  color: var(--ink);
}

.directory-layout,
.notifications-layout,
.architecture-layout {
  display: grid;
  gap: 16px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.record-card {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.record-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.record-card p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 14px;
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.code-panel {
  overflow: auto;
  max-height: 330px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #142221;
  color: #edf7f3;
  padding: 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--deep);
  color: white;
  padding: 13px 15px;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgb(24 32 31 / 48%);
  padding: 16px;
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.weight-modal {
  max-width: 420px;
}

.choice-card {
  display: grid;
  gap: 6px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: left;
}

.choice-card strong {
  color: var(--ink);
  font-size: 16px;
}

.choice-card span {
  color: var(--muted);
  font-size: 13px;
}

.cz-result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.cz-result-card.ok {
  border-color: rgb(36 114 79 / 35%);
  background: var(--green-soft);
}

.cz-result-card.warn {
  border-color: rgb(178 107 21 / 35%);
  background: var(--amber-soft);
}

.cz-result-card.block {
  border-color: rgb(164 55 50 / 35%);
  background: var(--red-soft);
}

.cz-result-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cz-result-title h2 {
  margin: 0;
  font-size: 20px;
}

.cz-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.cz-facts div {
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 8px;
  background: rgb(255 255 255 / 58%);
  padding: 9px;
}

.cz-facts span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.cz-facts strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.raw-code {
  margin-top: 10px;
}

.raw-code code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 8px;
  border-radius: 8px;
  background: rgb(20 34 33 / 88%);
  color: #fff;
  padding: 10px;
}

.vertical-actions {
  align-items: stretch;
  flex-direction: column;
  margin: 14px 0;
}

.cz-scan-list {
  display: grid;
  gap: 8px;
}

.cz-scan-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 150px 170px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.cz-scan-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.warehouse-app {
  min-height: 100vh;
  background: #f6f4ee;
}

html.screenshot-mobile,
html.screenshot-mobile body,
html.screenshot-mobile .warehouse-app {
  width: 390px;
  max-width: 390px;
  overflow-x: hidden;
}

.compact-topbar {
  position: static;
  min-height: 58px;
}

.compact-topbar .ghost-button {
  width: auto;
  min-width: 96px;
}

.simple-tabs {
  justify-content: center;
  padding: 8px 12px;
}

.warehouse-view {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 14px;
  overflow-x: hidden;
}

.keeper-screen {
  display: grid;
  gap: 16px;
}

.client-picker {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.client-picker span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.client-picker select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  outline: none;
}

.keeper-counters {
  display: grid;
  gap: 8px;
}

.keeper-counters div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 2px;
}

.keeper-counters span {
  min-width: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.keeper-counters strong {
  color: var(--ink);
  font-size: 21px;
  font-weight: 950;
  white-space: nowrap;
}

.main-scan-button {
  min-height: 82px;
  margin-top: 4px;
  font-size: 24px;
  letter-spacing: 0;
}

.center-text {
  text-align: center;
}

.last-scan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 28px rgb(24 32 31 / 7%);
}

.last-scan-card.ok {
  border-left: 6px solid var(--green);
}

.last-scan-card.warn {
  border-left: 6px solid var(--amber);
}

.last-scan-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.last-scan-card dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.last-scan-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}

.last-scan-card dt {
  color: var(--muted);
  font-weight: 800;
}

.last-scan-card dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
}

.scan-checks {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--green);
  font-weight: 900;
}

.fefo-warning {
  margin-top: 12px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #51350d;
  padding: 12px;
  font-weight: 800;
}

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

.keeper-list-screen h1 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.journal-entry,
.problem-entry {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.journal-entry time,
.problem-entry time {
  color: var(--muted);
  font-weight: 900;
}

.journal-entry h2,
.problem-entry h2 {
  margin: 0 0 5px;
  font-size: 17px;
}

.journal-entry p,
.problem-entry p {
  margin: 3px 0;
  color: var(--muted);
  line-height: 1.35;
}

.problem-entry {
  border-left: 5px solid var(--amber);
}

@media (max-width: 920px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: 310px;
    padding: 32px 22px;
  }

  .shipment-grid {
    grid-template-columns: 1fr;
  }

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

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

  .scanner-dock {
    grid-template-columns: 1fr 1fr;
  }

  .scan-line {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .userbox {
    width: 100%;
    justify-content: space-between;
  }

  .view {
    padding: 12px;
  }

  .panel-header,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls-grid,
  .picker-strip,
  .scan-actions,
  .manual-code,
  .draft-meta,
  .scan-summary,
  .scanner-dock {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .danger-button,
  .ghost-button,
  .scan-button {
    width: 100%;
  }

  .work-header {
    flex-direction: column;
  }

  .camera video {
    aspect-ratio: 4 / 3;
  }

  .line-facts {
    grid-template-columns: 1fr;
  }

  .marking-code-row,
  .cz-facts,
  .cz-scan-row {
    grid-template-columns: 1fr;
  }

  .cz-result-title {
    flex-direction: column;
  }
}
