:root {
  --bg: #eef2f4;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --ink: #172026;
  --muted: #66727a;
  --line: #d8e0e4;
  --nav: #243039;
  --nav-strong: #111a20;
  --teal: #0f766e;
  --teal-soft: #d8f1ee;
  --green: #2f855a;
  --green-soft: #dcf5e7;
  --amber: #b7791f;
  --amber-soft: #fff1d6;
  --red: #b83232;
  --red-soft: #ffe1df;
  --blue: #2c5282;
  --blue-soft: #dbeafe;
  --purple-soft: #ece3ff;
  --purple: #5b3ea6;
  --shadow: 0 18px 40px rgba(23, 32, 38, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.16), transparent 34%),
    linear-gradient(300deg, rgba(247, 201, 72, 0.22), transparent 38%),
    #eef2f4;
}

.auth-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.auth-brand {
  align-self: start;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #f7c948;
  color: #1b252d;
  font-weight: 900;
}

.auth-brand strong,
.brand strong,
.auth-brand small,
.brand small {
  display: block;
  line-height: 1.1;
}

.auth-brand strong,
.brand strong {
  font-size: 18px;
}

.auth-brand small,
.brand small {
  margin-top: 4px;
  color: var(--muted);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 42px;
  align-items: center;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.auth-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: 48px;
  line-height: 1.05;
}

.auth-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.auth-metrics span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.auth-metrics strong {
  color: var(--ink);
}

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

.auth-panel {
  padding: 18px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.is-active {
  background: var(--nav);
  color: #ffffff;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 10px 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px 16px;
  background: var(--nav);
  color: #f6fafb;
}

.sidebar .brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.sidebar .brand small {
  color: #bcc8ce;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #cfd9de;
  text-decoration: none;
}

.nav-link svg {
  width: 19px;
  height: 19px;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--nav-strong);
  color: #ffffff;
}

.shift-card {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.shift-card .label,
.shift-card .muted {
  color: #bcc8ce;
}

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

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 242, 244, 0.94);
  backdrop-filter: blur(14px);
}

.mobile-nav {
  display: none;
}

.search-box {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  max-width: 720px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-box svg {
  width: 18px;
  color: var(--muted);
}

.search-box input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.user-chip,
.command-bar button,
.period-switch button,
.segmented button,
.text-button,
.primary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
}

.icon-button svg {
  width: 18px;
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 12px 0 8px;
  border-radius: 8px;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.content {
  display: grid;
  gap: 20px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 26px 28px 40px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 7px;
  font-size: 16px;
  line-height: 1.25;
}

.period-switch,
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.period-switch button,
.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.period-switch button.is-active,
.segmented button.is-active {
  background: var(--nav);
  color: #ffffff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
}

.kpi-card {
  display: flex;
  gap: 14px;
  min-height: 126px;
  padding: 18px;
}

.kpi-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 26px;
  line-height: 1;
}

.kpi-card small {
  color: var(--muted);
}

.kpi-icon,
.module-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
}

.kpi-icon svg,
.module-icon svg {
  width: 20px;
}

.kpi-icon.receiving,
.kpi-icon.quarantine {
  background: var(--teal-soft);
  color: var(--teal);
}

.kpi-icon.stock {
  background: var(--green-soft);
  color: var(--green);
}

.kpi-icon.picking,
.kpi-icon.billing {
  background: var(--amber-soft);
  color: var(--amber);
}

.kpi-icon.shipping {
  background: var(--blue-soft);
  color: var(--blue);
}

.command-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.command-bar button,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 900;
}

.command-bar button svg,
.primary-action svg {
  width: 17px;
}

.command-bar .primary-action,
.primary-action {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.text-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--teal);
  font-weight: 900;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 12px;
}

.module-card {
  display: grid;
  gap: 10px;
  min-height: 178px;
  padding: 16px;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.module-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.module-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.module-card strong {
  align-self: end;
  color: var(--teal);
}

.module-card.is-active {
  border-color: var(--teal);
  background: #f2fbf9;
}

.module-icon {
  background: var(--surface-soft);
  color: var(--nav);
}

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

.module-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.module-header p {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.module-actions button,
.inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.module-actions button svg,
.inline-action svg {
  width: 16px;
}

.module-actions .primary-action {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.module-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
  gap: 18px;
  align-items: start;
}

.module-layout.single {
  grid-template-columns: 1fr;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.metric-tile {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip.good,
.status-chip.done,
.status-chip.paid,
.status-chip.active,
.status-chip.approved {
  background: var(--green-soft);
  color: var(--green);
}

.status-chip.warn,
.status-chip.open,
.status-chip.in-progress,
.status-chip.draft {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-chip.bad,
.status-chip.blocked,
.status-chip.overdue,
.status-chip.quarantine {
  background: var(--red-soft);
  color: var(--red);
}

.section-note {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

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

.record-card {
  display: grid;
  gap: 9px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.import-preview {
  display: grid;
  gap: 12px;
}

.import-preview input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.import-preview textarea {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

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

.import-errors {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.import-errors span {
  padding: 8px 10px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: 8px;
  background: rgba(254, 226, 226, 0.68);
  color: #991b1b;
  font-size: 13px;
}

.loader-row {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.receipts-panel {
  grid-column: 1 / -1;
}

.receipt-module {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: start;
}

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

.receipt-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.receipt-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.receipt-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.receipt-stats b {
  color: var(--ink);
  font-size: 18px;
}

.receipt-lines {
  display: grid;
  gap: 10px;
}

.receipt-line {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.35fr) minmax(120px, 1fr) minmax(70px, 0.45fr) minmax(70px, 0.45fr) 42px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.receipt-remove {
  align-self: end;
}

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

.receipt-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.receipt-actions svg {
  width: 16px;
}

.receipt-log {
  min-width: 0;
}

.receipt-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.receipt-log-head strong {
  color: var(--teal);
  font-size: 24px;
}

.receipt-table {
  min-width: 620px;
}

.warehouse-panel,
.quarantine-panel,
.documents-panel,
.activity-panel {
  grid-column: 2;
}

.tasks-panel,
.stock-panel,
.module-panel {
  grid-column: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.warehouse-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 68px);
  gap: 8px;
  min-height: 296px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(216, 224, 228, 0.45) 1px, transparent 1px),
    linear-gradient(rgba(216, 224, 228, 0.45) 1px, transparent 1px),
    #f9fbfb;
  background-size: 42px 42px;
}

.zone {
  display: flex;
  align-items: start;
  justify-content: space-between;
  min-width: 0;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.zone span {
  font-size: 12px;
  font-weight: 900;
}

.zone.low {
  background: var(--green-soft);
  border-color: #a7dfbd;
}

.zone.mid {
  background: var(--amber-soft);
  border-color: #f0cb83;
}

.zone.high {
  background: var(--red-soft);
  border-color: #f2aaa6;
}

.zone-1 {
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
}

.zone-2 {
  grid-column: 3 / span 2;
  grid-row: 1;
}

.zone-3 {
  grid-column: 5 / span 2;
  grid-row: 1 / span 2;
}

.zone-4 {
  grid-column: 3 / span 2;
  grid-row: 2 / span 2;
}

.zone-5 {
  grid-column: 1 / span 2;
  grid-row: 3 / span 2;
}

.zone-6 {
  grid-column: 5 / span 2;
  grid-row: 3 / span 2;
}

.dock-line {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 3 / span 2;
  grid-row: 4;
  border: 1px dashed #94a3ad;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.low {
  background: var(--green);
}

.legend-dot.mid {
  background: var(--amber);
}

.legend-dot.high {
  background: var(--red);
}

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

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

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

td {
  color: #2a363d;
}

td strong,
td span {
  display: block;
}

td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.task-status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.task-status.urgent {
  background: var(--red-soft);
  color: var(--red);
}

.task-status.progress {
  background: var(--blue-soft);
  color: var(--blue);
}

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

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.list-item strong,
.list-item span {
  display: block;
}

.list-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline time {
  color: var(--teal);
  font-weight: 900;
}

.timeline span {
  color: #334149;
  line-height: 1.45;
}

.timeline strong {
  display: block;
}

.action-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.action-dialog::backdrop {
  background: rgba(17, 26, 32, 0.42);
}

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

.dialog-body,
.dialog-grid,
.settings-list,
.export-box {
  display: grid;
  gap: 12px;
}

.settings-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.settings-list input {
  width: 18px;
  height: 18px;
}

.export-box textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--nav);
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1320px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
}

@media (max-width: 1500px) {
  .receipt-module {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    align-items: center;
    padding: 18px 12px;
  }

  .brand span:last-child,
  .nav-link span,
  .shift-card {
    display: none;
  }

  .nav-link {
    justify-content: center;
    width: 48px;
    padding: 0;
  }

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

  .module-layout {
    grid-template-columns: 1fr;
  }

  .receipt-module {
    grid-template-columns: 1fr;
  }

  .metric-strip,
  .record-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .warehouse-panel,
  .quarantine-panel,
  .documents-panel,
  .activity-panel,
  .receipts-panel,
  .tasks-panel,
  .stock-panel,
  .module-panel {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .auth-copy h1 {
    font-size: 36px;
  }

  .kpi-grid,
  .module-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .sidebar.is-open {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 25;
    display: flex;
    width: min(284px, calc(100vw - 48px));
  }

  .topbar {
    padding: 12px 16px;
  }

  .mobile-nav {
    display: grid;
  }

  .topbar-actions .user-chip,
  #print-labels {
    display: none;
  }

  .content {
    padding: 20px 16px 30px;
  }

  .page-head,
  .module-header,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .module-actions {
    justify-content: stretch;
  }

  .module-actions button,
  .inline-action {
    flex: 1 1 180px;
  }

  .period-switch,
  .segmented {
    width: 100%;
  }

  .period-switch button,
  .segmented button {
    flex: 1;
  }

  .receipt-toolbar,
  .receipt-line {
    grid-template-columns: 1fr;
  }

  .receipt-remove {
    width: 100%;
  }

  .kpi-grid,
  .module-grid,
  .metric-strip,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .command-bar button {
    flex: 1 1 190px;
  }

  .warehouse-map {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(6, 62px);
  }

  .zone-1,
  .zone-2,
  .zone-3,
  .zone-4,
  .zone-5,
  .zone-6,
  .dock-line {
    grid-column: auto;
    grid-row: auto;
  }

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

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 0;
    border-bottom: 0;
  }

  td:first-child,
  td:nth-child(2) {
    display: block;
  }
}

@media (max-width: 520px) {
  .auth-screen {
    padding: 18px;
  }

  .auth-copy h1 {
    font-size: 30px;
  }

  .auth-panel {
    padding: 14px;
  }

  .topbar {
    gap: 8px;
  }

  .search-box {
    height: 40px;
    padding: 0 10px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .topbar-actions {
    gap: 6px;
  }

  h1 {
    font-size: 25px;
  }

  .kpi-card {
    min-height: 112px;
  }

  .list-item {
    align-items: stretch;
    flex-direction: column;
  }
}
