:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f2;
  --ink: #18212b;
  --muted: #65717f;
  --line: #d8dee6;
  --primary: #176b5d;
  --primary-dark: #0f4f45;
  --accent: #bf6b2c;
  --warning: #9a6a06;
  --danger: #b53b36;
  --blue: #315f8f;
  --purple: #6250a0;
  --green-soft: #dcebe7;
  --orange-soft: #f3e3d2;
  --red-soft: #f5dddd;
  --shadow: 0 12px 30px rgba(24, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

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;
}

body.locked .app-header,
body.locked main {
  display: none;
}

body:not(.locked) .login-screen {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.login-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  place-items: center;
  padding: clamp(28px, 8vh, 76px) 24px;
  background:
    radial-gradient(ellipse at 5% 67%, rgba(255, 255, 255, 0.62) 0 7%, rgba(255, 255, 255, 0.34) 15%, transparent 31%),
    radial-gradient(ellipse at 18% 72%, rgba(255, 255, 255, 0.72) 0 8%, rgba(255, 255, 255, 0.36) 17%, transparent 34%),
    radial-gradient(ellipse at 36% 78%, rgba(255, 255, 255, 0.58) 0 7%, rgba(255, 255, 255, 0.28) 17%, transparent 35%),
    radial-gradient(ellipse at 64% 78%, rgba(255, 255, 255, 0.54) 0 8%, rgba(255, 255, 255, 0.3) 18%, transparent 35%),
    radial-gradient(ellipse at 82% 70%, rgba(255, 255, 255, 0.7) 0 8%, rgba(255, 255, 255, 0.34) 17%, transparent 33%),
    radial-gradient(ellipse at 96% 66%, rgba(255, 255, 255, 0.58) 0 7%, rgba(255, 255, 255, 0.3) 16%, transparent 31%),
    linear-gradient(180deg, #9ed8f2 0%, #dff3fb 48%, #f9fbff 100%);
}

.login-screen::before {
  content: "";
  position: absolute;
  top: 20%;
  left: 50%;
  z-index: 0;
  width: min(980px, 118vw);
  aspect-ratio: 1.75;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, transparent 58%, rgba(255, 255, 255, 0.42) 58.2% 58.45%, transparent 58.7%),
    radial-gradient(ellipse at center, transparent 73%, rgba(255, 255, 255, 0.34) 73.2% 73.45%, transparent 73.7%);
  opacity: 0.9;
  pointer-events: none;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: auto -12% -18% -12%;
  z-index: 0;
  height: min(560px, 56vh);
  background:
    radial-gradient(ellipse at 2% 62%, rgba(255, 255, 255, 0.98) 0 12%, rgba(255, 255, 255, 0.62) 22%, transparent 39%),
    radial-gradient(ellipse at 13% 38%, rgba(255, 255, 255, 0.96) 0 13%, rgba(255, 255, 255, 0.58) 24%, transparent 42%),
    radial-gradient(ellipse at 26% 55%, rgba(255, 255, 255, 0.94) 0 16%, rgba(255, 255, 255, 0.55) 29%, transparent 48%),
    radial-gradient(ellipse at 42% 41%, rgba(255, 255, 255, 0.9) 0 13%, rgba(255, 255, 255, 0.5) 25%, transparent 44%),
    radial-gradient(ellipse at 56% 63%, rgba(255, 255, 255, 0.96) 0 19%, rgba(255, 255, 255, 0.6) 31%, transparent 52%),
    radial-gradient(ellipse at 72% 45%, rgba(255, 255, 255, 0.92) 0 14%, rgba(255, 255, 255, 0.52) 27%, transparent 46%),
    radial-gradient(ellipse at 88% 58%, rgba(255, 255, 255, 0.98) 0 17%, rgba(255, 255, 255, 0.62) 30%, transparent 50%),
    radial-gradient(ellipse at 100% 38%, rgba(255, 255, 255, 0.95) 0 13%, rgba(255, 255, 255, 0.52) 26%, transparent 43%),
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.62) 42%, rgba(255, 255, 255, 0.94) 72%, #ffffff 100%);
  filter: blur(9px);
  pointer-events: none;
}

.login-clouds {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.login-cloud {
  position: absolute;
  display: block;
  width: clamp(330px, 34vw, 690px);
  height: clamp(126px, 14vw, 230px);
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 9% 68%, rgba(255, 255, 255, 0.9) 0 15%, transparent 40%),
    radial-gradient(ellipse at 24% 46%, rgba(255, 255, 255, 0.98) 0 20%, transparent 46%),
    radial-gradient(ellipse at 42% 62%, rgba(255, 255, 255, 0.94) 0 23%, transparent 50%),
    radial-gradient(ellipse at 62% 42%, rgba(255, 255, 255, 0.9) 0 18%, transparent 44%),
    radial-gradient(ellipse at 81% 64%, rgba(255, 255, 255, 0.96) 0 18%, transparent 46%),
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.74) 43%, rgba(255, 255, 255, 0.98) 100%);
  filter: blur(3px);
  opacity: 0.86;
}

.login-cloud::after {
  content: "";
  position: absolute;
  inset: 42% 2% 6%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 56px rgba(145, 174, 192, 0.16);
}

.login-cloud-left {
  left: -4vw;
  bottom: 16%;
}

.login-cloud-mid {
  left: 50%;
  bottom: 5%;
  width: clamp(430px, 44vw, 860px);
  height: clamp(132px, 15vw, 250px);
  transform: translateX(-50%) scaleX(1.15);
  opacity: 0.7;
}

.login-cloud-right {
  right: -5vw;
  bottom: 15%;
  transform: scaleX(-1);
}

.login-card {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: stretch;
  gap: 14px;
  width: min(100%, 360px);
  border: 1px solid rgba(89, 157, 190, 0.34);
  border-radius: 22px;
  padding: 31px 31px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.92));
  box-shadow:
    0 26px 64px rgba(61, 96, 123, 0.22),
    0 8px 20px rgba(27, 43, 54, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(222, 248, 255, 0.54), transparent 48%);
  pointer-events: none;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.login-logo {
  justify-self: center;
  width: min(100%, 224px);
  height: auto;
}

.login-mark {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(205, 217, 226, 0.76);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  color: #252a31;
  box-shadow: 0 8px 18px rgba(42, 66, 82, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.login-mark svg,
.login-field-icon,
.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.login-copy {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.login-card h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: 0;
}

.login-copy p:not(.eyebrow) {
  max-width: 286px;
  margin: 0;
  color: #5f6975;
  font-size: 14px;
  line-height: 1.42;
}

.login-fields {
  display: grid;
  gap: 10px;
  margin-top: 7px;
}

.login-input-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 35px;
  border: 1px solid rgba(224, 230, 237, 0.8);
  border-radius: 9px;
  background: rgba(239, 244, 249, 0.88);
  color: #717b87;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.login-input-row:focus-within {
  border-color: rgba(49, 95, 143, 0.34);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(49, 95, 143, 0.12);
}

.login-input-row input {
  min-height: 33px;
  border: 0;
  border-radius: inherit;
  padding: 7px 12px 7px 32px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  outline: 0;
}

.login-input-row input::placeholder {
  color: #747f8b;
}

.login-input-row input:focus {
  outline: 0;
}

.login-field-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  stroke-width: 2.1;
}

.login-input-row:has(.password-toggle) input {
  padding-right: 38px;
}

.forgot-link {
  justify-self: end;
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: #101820;
  font-size: 12px;
  font-weight: 600;
}

.forgot-link:hover,
.forgot-link:focus-visible {
  color: var(--primary);
}

.password-toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 7px;
  padding: 0;
  background: transparent;
  color: #6e7782;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  background: rgba(23, 107, 93, 0.1);
  color: var(--primary);
}

.password-toggle svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.login-submit {
  min-height: 36px;
  border: 1px solid #10131a;
  border-radius: 9px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #30323b 0%, #151820 50%, #07080c 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 20px rgba(8, 10, 14, 0.2);
}

.login-submit:hover,
.login-submit:focus-visible {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 13px 24px rgba(8, 10, 14, 0.24);
}

.demo-logins {
  width: 100%;
  border-top: 1px dashed rgba(126, 145, 160, 0.28);
  padding-top: 9px;
  color: #687482;
  font-size: 12px;
  text-align: center;
}

.demo-logins summary {
  cursor: pointer;
  list-style: none;
}

.demo-logins summary::-webkit-details-marker {
  display: none;
}

.demo-logins[open] {
  display: grid;
  gap: 5px;
}

.demo-logins span {
  display: block;
}

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

  .login-card {
    padding: 28px 22px 24px;
  }

  .login-copy p:not(.eyebrow) {
    font-size: 13px;
  }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.96);
  backdrop-filter: blur(10px);
}

.nav-side .app-header {
  margin-left: 0;
  padding-left: calc(324px + clamp(16px, 4vw, 48px));
}

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

.app-brand-logo {
  width: clamp(164px, 18vw, 224px);
  height: auto;
  flex: 0 0 auto;
}

.app-header h1,
.panel-heading h2,
.print-sheet h2 {
  margin: 0;
  letter-spacing: 0;
}

.app-header h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nav-group {
  position: relative;
}

.nav-group[hidden] {
  display: none !important;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border: 1px solid rgba(216, 222, 230, 0.9);
  border-radius: 8px;
  padding: 8px 11px 8px 13px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-group-toggle::-webkit-details-marker {
  display: none;
}

.nav-group-toggle::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.78;
}

.nav-group[open] .nav-group-toggle::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.nav-group.active > .nav-group-toggle,
.nav-group[open] > .nav-group-toggle {
  border-color: rgba(23, 107, 93, 0.22);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(23, 107, 93, 0.16);
}

.nav-group.active > .nav-group-toggle::after,
.nav-group[open] > .nav-group-toggle::after {
  color: #ffffff;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 5px;
  width: max-content;
  min-width: 236px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(24, 33, 43, 0.14);
}

.nav-menu .nav-button {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.nav-menu .nav-button::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #c6d0d9;
}

.nav-menu .nav-button:hover,
.nav-menu .nav-button:focus-visible {
  background: var(--surface-soft);
}

.nav-menu .nav-button.active {
  background: var(--primary);
  color: #ffffff;
}

.nav-menu .nav-button.active::before {
  background: #ffffff;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-tab {
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 8px 12px 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.admin-tab.active {
  border-bottom-color: var(--primary);
  color: var(--ink);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.session-box {
  min-width: 150px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.session-box strong {
  display: block;
  color: var(--ink);
}

.nav-button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
}

.nav-button {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.nav-button.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.nav-layout-toggle {
  white-space: nowrap;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--primary-dark);
}

.secondary-button {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--line);
}

.ghost-button {
  background: transparent;
  color: var(--primary);
  border-color: var(--line);
}

.danger-button {
  background: var(--red-soft);
  color: var(--danger);
  border-color: #edc2c0;
}

.icon-button {
  min-width: 38px;
  padding: 8px;
  background: var(--surface);
  border-color: var(--line);
}

main {
  padding: 18px clamp(16px, 4vw, 48px) 48px;
}

.nav-side main {
  margin-left: 324px;
}

.nav-side .top-nav {
  position: fixed;
  top: 14px;
  left: 14px;
  bottom: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 286px;
  height: calc(100dvh - 28px);
  min-height: calc(100vh - 28px);
  border: 1px solid rgba(216, 222, 230, 0.92);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(24, 33, 43, 0.14);
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-side .top-nav::before {
  content: "Lagerdesk";
  display: block;
  margin: 0 2px 18px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 18px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  text-transform: none;
}

.nav-side .nav-group,
.nav-side .nav-group-toggle {
  width: 100%;
}

.nav-side .nav-group-toggle {
  min-height: 46px;
  border-color: transparent;
  background: transparent;
  justify-content: space-between;
  color: var(--ink);
}

.nav-side .nav-menu {
  position: static;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 4px 0 10px 12px;
  background: transparent;
  box-shadow: none;
}

.nav-side .nav-group.active > .nav-group-toggle {
  background: #eef3f2;
  color: var(--primary-dark);
  box-shadow: none;
}

.nav-side .nav-group[open] > .nav-group-toggle {
  border-color: transparent;
  background: #f5f8f7;
  color: var(--ink);
  box-shadow: none;
}

.nav-side .nav-group.active[open] > .nav-group-toggle {
  background: var(--primary);
  color: #ffffff;
}

.nav-side .nav-menu .nav-button {
  min-height: 38px;
  border-radius: 8px;
  color: var(--muted);
}

.nav-side .nav-menu .nav-button::before {
  width: 2px;
  height: 18px;
  border-radius: 999px;
  background: #d8dee6;
}

.nav-side .nav-menu .nav-button.active {
  background: var(--ink);
  color: #ffffff;
}

.nav-side .nav-menu .nav-button.active::before {
  background: #ffffff;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  position: relative;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(24, 33, 43, 0.05);
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}

.metric:nth-child(2)::before {
  background: var(--blue);
}

.metric:nth-child(3)::before {
  background: var(--accent);
}

.metric:nth-child(4)::before {
  background: var(--danger);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
}

.dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr);
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 252, 0.94)),
    repeating-linear-gradient(90deg, rgba(49, 95, 143, 0.07) 0 1px, transparent 1px 76px);
  box-shadow: var(--shadow);
}

.dashboard-title {
  display: grid;
  gap: 4px;
}

.dashboard-toolbar h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.dashboard-title > p:last-child {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  font-weight: 650;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: 150px 150px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.dashboard-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.range-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 800;
}

.range-button.active,
.range-button:hover,
.range-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 0;
}

.dashboard-kpi {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--primary);
}

.dashboard-kpi-blue::before {
  background: var(--blue);
}

.dashboard-kpi-orange::before {
  background: var(--accent);
}

.dashboard-kpi-purple::before {
  background: var(--purple);
}

.dashboard-kpi-red::before {
  background: var(--danger);
}

.dashboard-kpi strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.dashboard-kpi small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.kpi-trend {
  align-self: end;
  width: fit-content;
  border-radius: 8px;
  padding: 5px 8px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.kpi-trend.positive {
  background: var(--green-soft);
  color: var(--primary-dark);
}

.kpi-trend.negative,
.kpi-trend.warning {
  background: var(--orange-soft);
  color: var(--warning);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr) minmax(280px, 0.85fr);
  gap: 14px;
}

.dashboard-card {
  min-height: 286px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-main-card {
  min-height: 332px;
}

.dashboard-wide {
  grid-column: span 2;
}

.dashboard-chart,
.rank-list,
.dashboard-status-panel,
.dashboard-alert-list,
.dashboard-recent-list,
.dashboard-return-list {
  padding: 0 18px 18px;
}

.dashboard-chart {
  min-height: 238px;
}

.dashboard-chip {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.dashboard-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 238px;
  color: var(--blue);
  overflow: visible;
}

.dashboard-chart svg.chart-orange {
  color: var(--accent);
}

.dashboard-chart text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-chart .chart-max-label {
  fill: currentColor;
}

.chart-grid line {
  stroke: #dce3ea;
  stroke-width: 1;
}

.chart-area {
  color: inherit;
}

.chart-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.chart-line-orange {
  stroke: var(--accent);
}

.chart-point {
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 3;
}

.chart-point-orange {
  stroke: var(--accent);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 10px;
}

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

.summary-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-row strong {
  font-size: 18px;
  text-align: right;
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
}

.rank-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rank-button,
.text-button {
  display: inline;
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  text-align: left;
}

.rank-button:hover,
.rank-button:focus-visible,
.text-button:hover,
.text-button:focus-visible {
  color: var(--primary);
  text-decoration: underline;
  outline-offset: 3px;
}

.rank-row > span {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.rank-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf0;
}

.rank-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.dashboard-status-panel,
.dashboard-alert-list,
.dashboard-recent-list,
.dashboard-return-list {
  display: grid;
  gap: 10px;
}

.status-row,
.alert-row,
.recent-order-row {
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.status-row {
  display: grid;
  gap: 10px;
}

.status-row > div:first-child,
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-row strong {
  font-size: 18px;
}

.status-track {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: #e7ebf0;
}

.status-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--primary));
}

.alert-row > div,
.recent-order-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.alert-row strong,
.recent-order-row strong,
.recent-order-row span {
  overflow-wrap: anywhere;
}

.recent-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto minmax(120px, 0.45fr);
  align-items: center;
  gap: 10px;
}

.recent-order-row > strong {
  text-align: right;
}

.positive-state {
  border-color: #c9ded8;
  background: #f2f8f6;
  color: var(--primary-dark);
}

.dashboard-table-panel {
  margin-top: 14px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace-grid,
.database-grid,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
}

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

.tool-panel {
  padding: 18px;
}

.table-panel {
  margin-top: 18px;
  overflow: hidden;
}

.database-grid {
  margin-top: 18px;
}

.database-grid .table-panel {
  margin-top: 0;
}

.database-grid .table-panel.admin-section.active {
  grid-column: 1 / -1;
}

.workspace-grid:not(:has(.admin-section.active)),
.database-grid:not(:has(.admin-section.active)) {
  display: none;
}

.split-layout .table-panel {
  margin-top: 0;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
}

.tool-panel > .panel-heading {
  padding: 0 0 18px;
}

.panel-heading.compact {
  padding-top: 0;
}

.panel-heading h2 {
  font-size: 19px;
  line-height: 1.2;
}

.report-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.form-grid label,
.inline-form label,
.order-line-builder label,
.pick-row label,
.station-scan label,
.problem-form label,
.package-grid label,
.pack-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-field {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  color: var(--ink) !important;
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
}

.delivery-address-fields {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.delivery-address-fields.is-hidden {
  display: none;
}

.pricing-manager {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}

.pricing-section {
  grid-column: 1 / -1;
}

.pricing-section .pricing-manager {
  margin: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pricing-section .pricing-manager > .panel-heading {
  padding: 18px;
}

.pricing-manager .panel-heading {
  padding: 14px 14px 0;
}

.pricing-manager .data-form {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.3fr) minmax(120px, 0.6fr) repeat(2, minmax(130px, 0.6fr)) auto;
  align-items: end;
  padding: 14px;
}

.pricing-manager .table-wrap {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.pricing-cleanup {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.pricing-cleanup-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.35fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.pricing-cleanup-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.section-subheading {
  margin-bottom: 12px;
}

.section-subheading h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

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

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(23, 107, 93, 0.2);
  outline-offset: 1px;
}

.wide-field {
  grid-column: 1 / -1;
}

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-input {
  max-width: 380px;
}

.customer-workbench {
  padding: 0 18px 18px;
}

.customer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-toolbar .search-input {
  flex: 1 1 260px;
  max-width: none;
}

.customer-editor {
  display: none;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.customer-editor.active {
  display: block;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

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

.numeric {
  text-align: right;
}

.stack {
  display: grid;
  gap: 6px;
}

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

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

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

.import-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.import-card > div,
.import-result {
  display: grid;
  gap: 5px;
}

.import-card a {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.import-result {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: var(--surface-soft);
}

.import-result:empty {
  display: none;
}

.order-import-result {
  margin: 12px 0 0;
}

.import-result ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.status-pill,
.location-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-ok {
  background: var(--green-soft);
  color: var(--primary-dark);
}

.status-warning {
  background: var(--orange-soft);
  color: var(--warning);
}

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

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

.location-pill {
  background: #edf2f7;
  color: #344256;
}

.order-form {
  padding: 0 18px 18px;
}

.document-mode-tabs,
.order-subtabs,
.return-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.document-mode-tabs {
  border-top: 1px solid var(--line);
}

.order-section,
.return-section,
.document-mode-panel,
.settings-section {
  display: none;
}

.order-section.active,
.return-section.active,
.document-mode-panel.active,
.settings-section.active {
  display: block;
}

.invoice-line-builder,
.return-line-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 140px 130px auto;
  align-items: end;
  gap: 10px;
}

.return-line-builder {
  grid-template-columns: minmax(260px, 1fr) 140px 140px 130px auto;
}

.return-article-field {
  min-width: 0;
}

.return-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.6fr) 180px;
  gap: 12px;
  padding: 0 18px 18px;
}

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

.return-source-heading {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.return-source-list {
  display: grid;
  gap: 8px;
}

.return-source-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.return-source-line > div {
  display: grid;
  gap: 2px;
}

.compact-line-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-line-field input {
  width: 112px;
}

.invoice-totals {
  display: grid;
  gap: 8px;
  max-width: 360px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
}

.settings-section > .form-grid,
.settings-section > .data-form {
  padding: 18px;
}

.data-form {
  padding: 0 18px 18px;
}

.order-line-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  align-items: end;
  gap: 10px;
}

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

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

.order-list {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.assignment-board {
  padding: 0 18px 18px;
}

.assignment-grid,
.stock-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.assignment-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.assignment-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.assignment-alert {
  border-left: 4px solid var(--accent);
}

.assignment-list {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.worker-stock-panel {
  margin-top: 18px;
}

.order-card {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  text-align: left;
}

.order-card.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.order-card strong {
  font-size: 16px;
}

.order-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  background: #fbfcfd;
  color: var(--muted);
}

.pick-lines,
.pack-lines {
  display: grid;
  gap: 12px;
}

.pick-row,
.pack-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.pick-row header,
.pack-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pick-go-to {
  color: var(--danger);
  font-weight: 850;
}

.pick-go-to strong {
  color: inherit;
  font-weight: 900;
}

.pick-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
}

.pick-handover {
  border: 1px solid #e8cda7;
  border-left: 4px solid #c27803;
  border-radius: 8px;
  padding: 14px;
  background: #fff8ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.pick-handover div {
  display: grid;
  gap: 4px;
}

.pick-handover span,
.document-note {
  color: var(--muted);
}

.operations-report {
  margin: 0 0 18px;
}

.ops-report {
  display: grid;
  gap: 12px;
}

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

.ops-kpi {
  min-height: 94px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfcfd;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.ops-kpi strong {
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.ops-kpi small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.ops-kpi-ok {
  border-left-color: var(--primary);
}

.ops-kpi-warning {
  border-left-color: var(--warning);
}

.ops-kpi-danger {
  border-left-color: var(--danger);
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 12px;
}

.ops-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.ops-section-wide {
  grid-column: span 2;
}

.ops-section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.ops-section-header h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.ops-chip {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 6px 9px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ops-empty {
  padding: 16px;
  color: var(--muted);
  background: #fff;
}

.ops-table {
  display: grid;
}

.ops-table-head,
.ops-table-row {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) 110px 80px 96px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
}

.ops-table-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fff;
}

.ops-table-row {
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.ops-table-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-list {
  display: grid;
}

.ops-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.ops-list-row:first-child {
  border-top: 0;
}

.ops-list-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ops-list-row span {
  color: var(--muted);
}

.ops-list-row b {
  white-space: nowrap;
}

.ops-list.compact .ops-list-row {
  padding-block: 10px;
}

.problem-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.65fr) minmax(130px, 0.65fr) 110px minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.problem-instruction {
  grid-column: 1 / -1;
  border: 1px solid #edcfae;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff8ef;
  color: var(--ink);
}

.problem-instruction:empty {
  display: none;
}

.return-scan {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: min(100%, 360px);
}

.return-scan input {
  min-width: 220px;
}

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

.return-receive-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.return-receive-card header,
.return-receive-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 180px;
  align-items: end;
  gap: 10px;
}

.return-receive-card header {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.return-receive-lines {
  display: grid;
  gap: 8px;
}

.return-receive-line {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.return-doc-heading {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.qr-code {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf0;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary);
}

.station-scan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
}

.pack-controls {
  max-width: 190px;
}

.package-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

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

.document-preview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

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

.address-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.message-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message-card {
  border: 1px solid #edcfae;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff8ef;
}

.message-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.message-card strong {
  color: var(--ink);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 33, 43, 0.38);
  backdrop-filter: blur(6px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  display: grid;
  gap: 14px;
  width: min(100%, 520px);
  border: 1px solid rgba(216, 222, 230, 0.98);
  border-radius: 8px;
  padding: 20px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(24, 33, 43, 0.22);
}

.customs-declaration-card {
  border-top: 5px solid var(--warning);
}

.pick-complete-card {
  border-top: 5px solid var(--primary);
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--warning);
  font-size: 24px;
  font-weight: 900;
}

.modal-icon-success {
  background: var(--green-soft);
  color: var(--primary-dark);
  font-size: 16px;
}

.modal-copy {
  display: grid;
  gap: 6px;
}

.modal-copy h2,
.modal-copy p,
.modal-note {
  margin: 0;
}

.modal-copy h2 {
  font-size: 22px;
  line-height: 1.2;
}

.modal-copy p,
.modal-note {
  color: var(--muted);
  line-height: 1.45;
}

.modal-summary {
  display: grid;
  grid-template-columns: minmax(110px, 0.4fr) minmax(0, 1fr);
  gap: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.modal-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.label-preview {
  display: grid;
  gap: 8px;
  max-width: 360px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 14px;
  background: #ffffff;
}

.label-barcode {
  height: 58px;
  background:
    repeating-linear-gradient(
      90deg,
      #111 0 3px,
      #fff 3px 6px,
      #111 6px 8px,
      #fff 8px 12px
    );
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.print-sheet {
  display: none;
}

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

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

@media (max-width: 980px) {
  .app-header,
  .header-actions,
  .panel-heading,
  .order-card-row,
  .pick-row header,
  .pack-row header {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-side .app-header,
  .nav-side main {
    margin-left: 0;
  }

  .nav-side .app-header {
    padding: 18px clamp(16px, 4vw, 48px);
  }

  .nav-side .top-nav {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-side .top-nav::before {
    display: none;
  }

  .top-nav,
  .nav-group,
  .nav-group-toggle {
    width: 100%;
  }

  .nav-menu {
    right: auto;
    left: 0;
    width: 100%;
    min-width: 0;
  }

  .metrics-strip,
  .dashboard-toolbar,
  .dashboard-filters,
  .dashboard-kpi-grid,
  .ops-kpi-grid,
  .workspace-grid,
  .database-grid,
  .split-layout,
  .dashboard-grid,
  .ops-layout,
  .recent-order-row {
    grid-template-columns: 1fr;
  }

  .dashboard-wide,
  .ops-section-wide {
    grid-column: auto;
  }

  .dashboard-chip,
  .recent-order-row > strong {
    text-align: left;
  }

  .form-grid,
  .pricing-manager .data-form,
  .pricing-cleanup-controls,
    .order-line-builder,
    .invoice-line-builder,
    .return-line-builder,
    .return-toolbar,
    .pick-controls,
  .problem-form,
  .station-scan,
  .package-grid,
  .assignment-grid,
  .stock-tools-grid,
  .return-receive-card header,
  .return-receive-line,
  .address-columns {
    grid-template-columns: 1fr;
  }

  .ops-table-head {
    display: none;
  }

  .ops-table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .search-input {
    max-width: none;
  }
}

@media print {
  body > *:not(.print-active) {
    display: none !important;
  }

  .print-active {
    display: block !important;
  }

  .print-sheet {
    width: 100%;
    padding: 32px;
    color: #000000;
    font-family: Arial, sans-serif;
  }

  .print-sheet header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 2px solid #000000;
    padding-bottom: 18px;
    margin-bottom: 24px;
  }

  .print-sheet table {
    margin-top: 18px;
  }

  .print-sheet th,
  .print-sheet td {
    border: 1px solid #000000;
  }
}
