:root {
  --ink: #18211f;
  --muted: #66716e;
  --line: #e2e8e5;
  --paper: #ffffff;
  --canvas: #f4f7f5;
  --green: #175c4b;
  --green-2: #24765f;
  --green-soft: #e8f3ef;
  --lime: #c8ee6f;
  --amber: #a76512;
  --amber-soft: #fff4dc;
  --red: #9e3b3b;
  --red-soft: #fceaea;
  --shadow: 0 18px 50px rgba(25, 58, 48, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 0%, rgba(200, 238, 111, .18), transparent 27rem),
    var(--canvas);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(226, 232, 229, .8);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.03em; }
.brand small { display: block; color: var(--muted); margin-top: 1px; }
.brand-mark, .auth-logo { display: grid; grid-template-columns: repeat(3, 6px); gap: 3px; align-items: end; }
.brand-mark { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--green); }
.brand-mark span, .auth-logo span { display: block; background: var(--lime); border-radius: 3px; }
.brand-mark span:nth-child(1), .auth-logo span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2), .auth-logo span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3), .auth-logo span:nth-child(3) { height: 12px; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.live-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; margin-right: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 99px; background: #aeb8b4; box-shadow: 0 0 0 4px rgba(174, 184, 180, .16); }
.live-status.online .status-dot { background: #36a879; box-shadow: 0 0 0 4px rgba(54, 168, 121, .14); }
.live-status.error .status-dot { background: #d36161; box-shadow: 0 0 0 4px rgba(211, 97, 97, .14); }
.icon-button, .avatar-button {
  width: 40px; height: 40px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px;
  display: grid; place-items: center; color: var(--ink); transition: .18s ease;
}
.icon-button:hover, .avatar-button:hover { border-color: #b8c8c1; transform: translateY(-1px); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.busy svg { animation: spin .8s linear infinite; }
.avatar-button { border: 0; background: var(--green); color: white; font-weight: 750; border-radius: 50%; }

.main-content { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 48px; flex: 1; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 8px; color: var(--green-2); font-size: 12px; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(34px, 6vw, 56px); line-height: .98; letter-spacing: -.055em; margin-bottom: 16px; }
.hero-copy { max-width: 650px; color: var(--muted); font-size: 17px; line-height: 1.65; margin-bottom: 0; }
.unread-card { min-width: 148px; padding: 18px 22px; border-radius: 20px; color: white; background: var(--green); box-shadow: var(--shadow); }
.unread-card span { display: block; }
.unread-number { font-size: 36px; font-weight: 800; letter-spacing: -.05em; line-height: 1; margin-bottom: 6px; }
.unread-card span:last-child { opacity: .72; font-size: 12px; }

.inbox-panel { background: var(--paper); border: 1px solid rgba(226, 232, 229, .8); border-radius: 28px; padding: clamp(22px, 4vw, 38px); box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 28px; letter-spacing: -.04em; margin-bottom: 0; }
.filters { display: flex; gap: 5px; padding: 4px; background: var(--canvas); border-radius: 12px; }
.filter { border: 0; background: transparent; color: var(--muted); padding: 8px 13px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.filter.active { color: var(--green); background: white; box-shadow: 0 2px 9px rgba(20, 55, 44, .08); }

.notice { margin: 20px 0 0; padding: 12px 15px; border-radius: 12px; font-size: 14px; background: var(--amber-soft); color: var(--amber); }
.notice.error { background: var(--red-soft); color: var(--red); }
.message-list { padding-top: 8px; }
.message-card { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 15px; padding: 22px 5px; border-bottom: 1px solid var(--line); }
.message-card:last-child { border-bottom: 0; padding-bottom: 5px; }
.message-card.unread::before { content: ""; position: absolute; left: -15px; top: 35px; width: 6px; height: 6px; border-radius: 99px; background: var(--green-2); }
.message-avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); font-weight: 850; }
.message-card.alert .message-avatar { color: var(--amber); background: var(--amber-soft); }
.message-card.question .message-avatar { background: var(--green); color: white; }
.message-card.user .message-avatar { color: #51615d; background: #edf1ef; }
.message-heading { display: flex; justify-content: space-between; gap: 18px; margin: 1px 0 7px; }
.message-heading h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.message-time { white-space: nowrap; color: #8a9591; font-size: 12px; }
.message-body { white-space: pre-line; color: #48534f; font-size: 15px; line-height: 1.58; margin-bottom: 0; }
.message-tag { display: inline-flex; align-items: center; margin-top: 12px; padding: 5px 9px; border-radius: 8px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.message-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.action-button, .primary-button {
  border: 0; border-radius: 11px; padding: 10px 15px; font-weight: 750; font-size: 13px; transition: .18s ease;
}
.action-button { color: var(--green); background: var(--green-soft); }
.action-button.primary, .primary-button { color: white; background: var(--green); }
.action-button.danger { color: var(--red); background: var(--red-soft); }
.action-button.secondary { color: #53615c; background: #edf2f0; }
.action-button:hover, .primary-button:hover { transform: translateY(-1px); filter: brightness(.97); }
.action-button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.answer-note { width: 100%; max-width: 560px; min-height: 70px; margin-top: 12px; padding: 11px 13px; resize: vertical; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); outline: none; }
.answer-note:focus, .token-field:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(36, 118, 95, .1); }

.empty-state { text-align: center; padding: 60px 20px 40px; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 18px; color: var(--green); background: var(--green-soft); font-size: 24px; }
.empty-state h3 { margin-bottom: 7px; }
.empty-state p { margin: 0 auto; max-width: 440px; color: var(--muted); line-height: 1.55; }
.skeleton-card { height: 125px; margin-top: 12px; border-radius: 16px; background: linear-gradient(90deg, #f1f4f2 25%, #f8faf9 45%, #f1f4f2 65%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
.skeleton-card.short { height: 92px; }

footer { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 28px; color: #89938f; font-size: 12px; display: flex; justify-content: space-between; gap: 20px; }

.auth-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(13, 31, 26, .68); backdrop-filter: blur(12px); }
.auth-card { width: min(430px, 100%); padding: 38px; border-radius: 26px; background: white; box-shadow: 0 30px 90px rgba(0, 0, 0, .2); }
.auth-logo { width: 48px; height: 48px; grid-template-columns: repeat(3, 7px); padding: 11px; margin-bottom: 26px; border-radius: 15px; background: var(--green); }
.auth-card h2 { font-size: 30px; letter-spacing: -.045em; margin-bottom: 10px; }
.auth-card > p:not(.eyebrow):not(.form-error) { color: var(--muted); line-height: 1.55; margin-bottom: 24px; }
.auth-card label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 750; }
.token-field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: .18s ease; }
.token-field input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 12px 14px; color: var(--ink); }
.token-field button { align-self: stretch; padding: 0 13px; border: 0; color: var(--green); background: white; font-size: 12px; font-weight: 750; }
.form-error { margin: 10px 0 0; color: var(--red); font-size: 13px; }
.primary-button.full { width: 100%; margin-top: 18px; padding: 13px; }
.auth-card > small { display: block; margin-top: 16px; color: #909995; line-height: 1.5; text-align: center; }

.details-dialog { width: min(920px, calc(100% - 32px)); max-height: 86vh; padding: 28px; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 30px 90px rgba(0, 0, 0, .25); }
.details-dialog::backdrop { background: rgba(13, 31, 26, .58); backdrop-filter: blur(6px); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin-bottom: 16px; font-size: 24px; }
.dialog-heading .icon-button { font-size: 22px; }
.details-content { overflow: auto; max-height: 68vh; padding-right: 4px; }
.details-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.detail-metric { padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--canvas); }
.detail-metric strong, .detail-metric span { display: block; }
.detail-metric strong { margin-bottom: 3px; color: var(--green); font-size: 22px; letter-spacing: -.03em; }
.detail-metric span { color: var(--muted); font-size: 12px; }
.details-safety { margin-bottom: 18px; padding: 12px 14px; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 13px; line-height: 1.5; }
.supply-cluster { margin-top: 18px; }
.supply-cluster-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.supply-cluster-heading h3 { margin: 0; font-size: 17px; }
.supply-cluster-heading span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.supply-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.supply-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.supply-table th, .supply-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.supply-table th { color: var(--muted); background: var(--canvas); font-size: 11px; letter-spacing: .035em; text-transform: uppercase; }
.supply-table tbody tr:last-child td { border-bottom: 0; }
.supply-table td:first-child { min-width: 190px; }
.supply-table td strong, .supply-table td small { display: block; }
.supply-table td small { max-width: 360px; margin-top: 3px; color: var(--muted); line-height: 1.35; }
.supply-sku { color: var(--muted); white-space: nowrap; }
.supply-quantity { font-weight: 750; white-space: nowrap; }
.supply-priority { display: inline-flex; padding: 5px 8px; border-radius: 8px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.supply-priority.medium { color: var(--amber); background: var(--amber-soft); }
.supply-priority.normal { color: #53615c; background: #edf2f0; }
.details-source { margin: 18px 2px 2px; color: var(--muted); font-size: 12px; }
.technical-json { overflow: auto; max-height: 55vh; margin: 0; padding: 16px; border-radius: 14px; color: #dce9e4; background: #17241f; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (max-width: 700px) {
  .topbar { height: 66px; padding: 0 16px; }
  .brand small, .live-status span:last-child { display: none; }
  .live-status { margin-right: 0; }
  .main-content { width: min(100% - 24px, 1040px); padding-top: 34px; }
  .hero { align-items: stretch; flex-direction: column; margin-bottom: 24px; }
  .unread-card { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 14px 17px; }
  .unread-number { margin: 0; font-size: 24px; }
  .inbox-panel { border-radius: 22px; padding: 20px 17px; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .filters { width: 100%; overflow-x: auto; }
  .filter { flex: 1; white-space: nowrap; }
  .message-card { grid-template-columns: 38px 1fr; gap: 11px; padding: 19px 2px; }
  .message-avatar { width: 38px; height: 38px; border-radius: 12px; }
  .message-heading { flex-direction: column; gap: 4px; }
  .auth-card { padding: 28px 22px; }
  .details-dialog { padding: 22px 16px; }
  .details-summary { grid-template-columns: 1fr; }
  .supply-cluster-heading { align-items: start; flex-direction: column; gap: 4px; }
  footer { width: calc(100% - 30px); flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* Mobile warehouse workspace */
.workspace-tabs {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 32px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .75);
}
.workspace-tab {
  min-height: 40px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}
.workspace-tab.active {
  color: white;
  background: var(--green);
  box-shadow: 0 7px 18px rgba(23, 92, 75, .18);
}

.warehouse-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}
.warehouse-hero h1 { margin-bottom: 14px; }
.warehouse-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr));
  min-width: min(430px, 46%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
}
.warehouse-metric {
  padding: 18px 17px;
  border-right: 1px solid var(--line);
}
.warehouse-metric:last-child { border-right: 0; }
.warehouse-metric strong,
.warehouse-metric span { display: block; }
.warehouse-metric strong {
  margin-bottom: 5px;
  color: var(--green);
  font-size: 26px;
  letter-spacing: -.04em;
}
.warehouse-metric span {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr);
  gap: 22px;
  align-items: start;
}
.warehouse-panel,
.warehouse-history {
  border: 1px solid rgba(226, 232, 229, .88);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.warehouse-panel { padding: clamp(20px, 3.2vw, 34px); }
.warehouse-history {
  position: sticky;
  top: 96px;
  padding: 24px;
}
.panel-heading.compact { padding-bottom: 20px; }
.safe-badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 800;
}

#warehouseForm { padding-top: 22px; }
.field-label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.warehouse-select,
.warehouse-comment,
.warehouse-line input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  outline: none;
  transition: .18s ease;
}
.warehouse-select { min-height: 46px; padding: 10px 12px; }
.warehouse-comment {
  min-height: 78px;
  padding: 12px 13px;
  resize: vertical;
}
.warehouse-select:focus,
.warehouse-comment:focus,
.warehouse-line input:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(36, 118, 95, .1);
}
.warehouse-lines-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 9px;
}
.warehouse-lines-heading .field-label { margin-bottom: 3px; }
.warehouse-lines-heading small { color: var(--muted); }
.warehouse-line-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.text-button {
  padding: 6px 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}
.scan-button,
.secondary-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--green);
  background: white;
  font-size: 13px;
  font-weight: 800;
  transition: .18s ease;
}
.scan-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.scan-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.scan-button:hover,
.secondary-button:hover {
  border-color: #b8c8c1;
  background: var(--green-soft);
  transform: translateY(-1px);
}
.scan-button:disabled,
.secondary-button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}
.warehouse-lines {
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
}
.warehouse-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 38px;
  gap: 8px;
  align-items: start;
}
.warehouse-line input { min-height: 44px; padding: 10px 11px; }
.warehouse-line-meta {
  grid-column: 1 / 3;
  min-height: 17px;
  margin: -3px 5px 1px;
  color: var(--muted);
  font-size: 11px;
}
.remove-line {
  width: 38px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--red);
  background: white;
  font-size: 20px;
}
.warehouse-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.warehouse-form-actions span {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-preview,
.warehouse-draft {
  margin-top: 24px;
  padding: 21px;
  border: 1px solid #bed8ce;
  border-radius: 18px;
  background: #f5fbf8;
}
.warehouse-preview-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}
.warehouse-preview-heading h3 { margin-bottom: 0; }
.warehouse-preview-heading > strong {
  color: var(--green);
  font-size: 20px;
  white-space: nowrap;
}
.warehouse-preview-lines {
  display: grid;
  gap: 7px;
}
.warehouse-preview-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: white;
}
.warehouse-preview-line strong { font-size: 13px; }
.warehouse-preview-line span {
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}
.warehouse-safety {
  margin: 14px 0;
  color: var(--green);
  font-size: 12px;
  line-height: 1.5;
}
.full-mobile { margin-top: 14px; }
.draft-status {
  display: inline-flex;
  margin-bottom: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
}
.warehouse-draft h3 { margin-bottom: 7px; }
.warehouse-draft > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.confirm-check {
  display: flex;
  gap: 10px;
  align-items: start;
  margin-top: 17px;
  padding: 13px;
  border-radius: 12px;
  background: white;
  font-size: 13px;
  line-height: 1.45;
}
.confirm-check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.history-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}
.history-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.03em;
}
.history-heading > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.warehouse-document-card {
  padding: 15px 1px;
  border-bottom: 1px solid var(--line);
}
.warehouse-document-card:last-child { border-bottom: 0; }
.document-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}
.document-card-heading strong { font-size: 13px; }
.document-status {
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 850;
}
.document-status.draft {
  color: var(--amber);
  background: var(--amber-soft);
}
.document-status.reversed {
  color: var(--red);
  background: var(--red-soft);
}
.warehouse-document-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.resume-draft {
  margin-top: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 11px;
  font-weight: 800;
}

.barcode-dialog {
  width: min(620px, calc(100% - 24px));
  max-height: min(92vh, 820px);
  padding: 25px;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
  overflow-y: auto;
}
.barcode-dialog::backdrop {
  background: rgba(13, 31, 26, .64);
  backdrop-filter: blur(7px);
}
.barcode-dialog .dialog-heading h2 { margin-bottom: 0; }
.barcode-intro {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.barcode-camera {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid #bed8ce;
  border-radius: 18px;
  background: #16231f;
}
.barcode-camera video {
  display: none;
  width: 100%;
  min-height: 260px;
  max-height: 390px;
  object-fit: cover;
}
.barcode-camera.active video { display: block; }
.barcode-frame {
  position: absolute;
  z-index: 2;
  width: min(78%, 410px);
  height: 40%;
  min-height: 110px;
  border: 2px solid rgba(200, 238, 111, .94);
  border-radius: 16px;
  box-shadow:
    0 0 0 999px rgba(5, 13, 11, .24),
    0 0 30px rgba(200, 238, 111, .2);
  opacity: 0;
  pointer-events: none;
}
.barcode-camera.active .barcode-frame { opacity: 1; }
.barcode-camera-placeholder {
  display: grid;
  gap: 6px;
  padding: 26px;
  color: white;
  text-align: center;
}
.barcode-camera-placeholder strong { font-size: 17px; }
.barcode-camera-placeholder span {
  color: rgba(255, 255, 255, .68);
  font-size: 12px;
  line-height: 1.45;
}
.barcode-camera-actions {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}
.barcode-camera-actions button { flex: 1; }
.barcode-status {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  color: #53615c;
  background: #edf2f0;
  font-size: 13px;
  line-height: 1.45;
}
.barcode-status.success {
  color: var(--green);
  background: var(--green-soft);
}
.barcode-status.error {
  color: var(--red);
  background: var(--red-soft);
}
.barcode-status.busy {
  color: var(--amber);
  background: var(--amber-soft);
}
.barcode-manual-form {
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.barcode-manual-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.barcode-manual-form input,
.barcode-bind input {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
  outline: none;
}
.barcode-manual-form input:focus,
.barcode-bind input:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(36, 118, 95, .1);
}
.barcode-bind {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid #e9d39c;
  border-radius: 15px;
  background: #fffaf0;
}
.barcode-bind h3 { margin-bottom: 6px; }
.barcode-bind > p:not(.eyebrow) {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 13px;
}
.barcode-bind small {
  display: block;
  min-height: 18px;
  margin: 6px 2px 12px;
  color: var(--muted);
  line-height: 1.4;
}
.barcode-bind .primary-button { width: 100%; }
.barcode-safety {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .warehouse-hero { align-items: stretch; flex-direction: column; }
  .warehouse-metrics { width: 100%; min-width: 0; }
  .warehouse-layout { grid-template-columns: 1fr; }
  .warehouse-history { position: static; }
}

@media (max-width: 700px) {
  .workspace-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin-bottom: 24px;
  }
  .workspace-tab { width: 100%; }
  .warehouse-hero { margin-bottom: 20px; }
  .warehouse-hero h1 { font-size: 36px; }
  .warehouse-metrics { grid-template-columns: repeat(3, 1fr); }
  .warehouse-metric { padding: 14px 10px; }
  .warehouse-metric strong { font-size: 21px; }
  .warehouse-panel,
  .warehouse-history { border-radius: 20px; }
  .warehouse-panel { padding: 19px 15px; }
  .panel-heading.compact { align-items: start; }
  .safe-badge { align-self: start; }
  .warehouse-lines-heading { align-items: start; flex-direction: column; gap: 5px; }
  .warehouse-line-actions {
    width: 100%;
    justify-content: space-between;
  }
  .warehouse-line { grid-template-columns: minmax(0, 1fr) 92px 38px; }
  .warehouse-form-actions { align-items: stretch; flex-direction: column; }
  .warehouse-form-actions .primary-button,
  .full-mobile { width: 100%; min-height: 46px; }
  .warehouse-preview,
  .warehouse-draft { padding: 17px 13px; }
  .warehouse-preview-line { grid-template-columns: 1fr; gap: 3px; }
  .barcode-dialog {
    width: calc(100% - 12px);
    max-height: calc(100vh - 12px);
    padding: 18px 14px;
    border-radius: 20px;
  }
  .barcode-camera,
  .barcode-camera video { min-height: 225px; }
  .barcode-camera-actions { flex-direction: column; }
  .barcode-camera-actions button,
  .barcode-manual-form button { min-height: 44px; }
}
