:root {
  --bg: #eef3f8;
  --bg2: #ffffff;
  --bg3: #f6f9fc;
  --bg4: #dde6f0;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --border: rgba(145, 163, 184, 0.22);
  --border2: rgba(101, 123, 147, 0.24);
  --border3: rgba(68, 90, 115, 0.28);
  --text: #102033;
  --text2: #506277;
  --text3: #7a8ca0;
  --accent: #205ea6;
  --accent2: #0f2a45;
  --accent-soft: rgba(32, 94, 166, 0.12);
  --gold: #c69338;
  --green: #15704f;
  --red: #b24b4b;
  --blue: #3a78b8;
  --orange: #c66b2d;
  --shadow: 0 22px 60px rgba(15, 31, 50, 0.08);
  --shadow-strong: 0 32px 90px rgba(12, 27, 43, 0.14);
  --font-body: "Aptos", "IBM Plex Sans", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-display: "Aptos Display", "Aptos", "IBM Plex Sans", "Segoe UI Variable", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}
body {
  background: var(--bg);
  position: relative;
}
body[data-theme="dark"] {
  --bg: #09111d;
  --bg2: #0f1927;
  --bg3: #142031;
  --bg4: #1a2940;
  --panel: rgba(15, 25, 39, 0.86);
  --panel-strong: #101b2a;
  --border: rgba(118, 146, 179, 0.16);
  --border2: rgba(128, 157, 191, 0.22);
  --border3: rgba(142, 174, 209, 0.24);
  --text: #edf5ff;
  --text2: #afc0d5;
  --text3: #7f92a9;
  --accent: #73b2ff;
  --accent2: #d9eaff;
  --accent-soft: rgba(115, 178, 255, 0.14);
  --gold: #f2be61;
  --green: #5fd09b;
  --red: #e38787;
  --blue: #7fc1ff;
  --orange: #f0a663;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  --shadow-strong: 0 38px 100px rgba(0, 0, 0, 0.44);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(40, 104, 179, 0.11), transparent 28%),
    radial-gradient(circle at right 20%, rgba(198, 147, 56, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 28%);
  opacity: 1;
}
body[data-theme="dark"]::before {
  background:
    radial-gradient(circle at top left, rgba(115, 178, 255, 0.14), transparent 26%),
    radial-gradient(circle at right 18%, rgba(242, 190, 97, 0.08), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 28%);
}

.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 10%, rgba(78, 148, 255, 0.22), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(53, 224, 156, 0.12), transparent 22%),
    linear-gradient(180deg, #09111d 0%, #0b1320 58%, #101826 100%);
  position: relative;
}
.login-shell::before,
.public-site::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 192, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 192, 255, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.75), transparent 82%);
  opacity: 0.16;
}
.login-card {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 430px);
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(126, 154, 188, 0.16);
  background: rgba(9, 17, 29, 0.76);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px);
  position: relative;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 34px;
}
.login-copy, .login-form-wrap { padding: 48px; }
.login-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  background:
    radial-gradient(circle at 16% 18%, rgba(115, 178, 255, 0.26), transparent 26%),
    radial-gradient(circle at 78% 26%, rgba(99, 64, 255, 0.16), transparent 24%),
    linear-gradient(160deg, rgba(9, 17, 29, 0.98), rgba(13, 24, 40, 0.98) 58%, rgba(8, 14, 24, 0.99));
  color: #f6f8fa;
  position: relative;
}
.login-copy::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.03), transparent 46%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 40%);
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.hero-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}
.hero-brand-copy {
  margin-top: 6px;
  color: rgba(245, 248, 250, 0.56);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.hero-title {
  margin: 18px 0 14px;
  font-size: clamp(38px, 4vw, 64px);
  line-height: 0.94;
  letter-spacing: -0.07em;
  font-family: var(--font-display);
}
.login-headline-line,
.site-headline-line {
  display: block;
}
.login-headline-gradient,
.site-headline-gradient {
  background: linear-gradient(90deg, #f4f8ff 0%, #83d7ff 42%, #69ffbf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy {
  max-width: 560px;
  color: rgba(237, 243, 247, 0.72);
  font-size: 16px;
  line-height: 1.68;
  margin-bottom: 20px;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.login-quiet-note {
  color: rgba(237, 243, 247, 0.56);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.hero-metric {
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 18px 32px rgba(0,0,0,0.14);
}
.hero-metric .k {
  color: rgba(245, 248, 250, 0.65);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.hero-metric .v {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: var(--font-display);
}
.login-form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(10, 19, 31, 0.9), rgba(12, 21, 34, 0.94)),
    radial-gradient(circle at top right, rgba(83, 210, 255, 0.12), transparent 34%);
  backdrop-filter: blur(12px);
}
.login-form-kicker {
  margin-bottom: 10px;
  color: #8fd4ff;
}
.login-form-wrap h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.03em;
  font-family: var(--font-display);
  color: #f7fbff;
}
.login-form-wrap p {
  margin: 0 0 24px;
  color: rgba(219, 231, 244, 0.68);
  line-height: 1.55;
}
.form-row { display: grid; gap: 8px; margin-bottom: 16px; }
label {
  color: rgba(219, 231, 244, 0.74);
  font-size: 12px;
  font-weight: 600;
}
input, button {
  font-family: inherit;
}
input, select, textarea {
  border: 1px solid rgba(126, 154, 188, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #f4f8ff;
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 14px;
  outline: none;
}
input::placeholder,
textarea::placeholder {
  color: rgba(219, 231, 244, 0.34);
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(105, 221, 185, 0.6);
  box-shadow: 0 0 0 3px rgba(105, 221, 185, 0.12);
}
button {
  cursor: pointer;
  border: 0;
}
.primary, .secondary {
  border-radius: 14px;
  padding: 11px 17px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.primary {
  color: #04101b;
  background: linear-gradient(135deg, #8df6c1, #79e6ff);
  box-shadow: 0 18px 36px rgba(91, 226, 201, 0.2);
}
.secondary {
  color: #eaf4ff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(126, 154, 188, 0.18);
  box-shadow: 0 8px 20px rgba(16, 32, 51, 0.04);
}
.theme-toggle {
  min-width: 96px;
}
.demo {
  display: none;
}
.error {
  min-height: 20px;
  margin: 8px 0 0;
  color: #b24f41;
  font-size: 13px;
}

.public-site {
  background:
    radial-gradient(circle at 10% 8%, rgba(88, 162, 255, 0.14), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(83, 210, 255, 0.08), transparent 18%),
    radial-gradient(circle at 72% 72%, rgba(64, 255, 180, 0.05), transparent 18%),
    linear-gradient(180deg, #060d16 0%, #09111d 58%, #0d1623 100%);
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  backdrop-filter: blur(20px);
  background: rgba(6, 13, 22, 0.58);
  border-bottom: 1px solid rgba(126, 154, 188, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.site-header-inner,
.site-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
}
.site-header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}
.site-brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.site-brand-kicker {
  color: #7ec0ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.site-brand-name {
  margin-top: 4px;
  color: #edf6ff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-nav a {
  color: rgba(219, 231, 244, 0.6);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease, transform 160ms ease;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: #f4fbff;
  transform: translateY(-1px);
}
.site-nav-login {
  min-width: 116px;
  text-align: center;
}

.site-nav a.site-nav-login {
  color: #07101b;
  background: #ffffff;
  border-color: rgba(21, 35, 49, 0.12);
}

.site-nav a.site-nav-login:hover,
.site-nav a.site-nav-login:focus-visible {
  color: #07101b;
  background: #f5fbff;
}

.site-shell {
  padding: 48px 0 88px;
}
.site-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 420px);
  gap: 18px;
  align-items: stretch;
}
.site-hero-copy,
.site-hero-panel,
.site-card,
.site-pricing-card {
  border-radius: 30px;
  border: 1px solid rgba(126, 154, 188, 0.12);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.28);
}
.site-hero-copy {
  padding: 58px 54px;
  background:
    radial-gradient(circle at 18% 10%, rgba(88, 162, 255, 0.16), transparent 22%),
    radial-gradient(circle at 78% 24%, rgba(83, 210, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(9,17,29,0.9), rgba(9,17,29,0.98));
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}
.site-hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -20% -36% 36%;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(83, 210, 255, 0.14), transparent 66%);
  filter: blur(16px);
  pointer-events: none;
}
.site-hero-copy h1 {
  margin: 18px 0 16px;
  font-size: clamp(52px, 6vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.075em;
  font-family: var(--font-display);
  max-width: 720px;
  color: #f6fbff;
}
.site-hero-copy p {
  margin: 0;
  max-width: 580px;
  color: rgba(219, 231, 244, 0.72);
  font-size: 17px;
  line-height: 1.7;
}
.site-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.site-hero-actions a {
  text-decoration: none;
}
.site-hero-strip {
  display: none;
}
.site-hero-mini {
  margin-top: 26px;
  color: rgba(143, 212, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.site-strip-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(237,243,249,0.88));
  border: 1px solid rgba(145, 163, 184, 0.22);
}
.site-strip-card .k {
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}
.site-strip-card .v {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}
.site-hero-panel {
  padding: 26px;
  background:
    radial-gradient(circle at top left, rgba(88, 162, 255, 0.12), transparent 34%),
    linear-gradient(165deg, rgba(9, 16, 26, 0.98), rgba(11, 19, 31, 0.98));
  color: #edf3f7;
  position: relative;
  overflow: hidden;
}
.site-hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 192, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 192, 255, 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.28;
}
.site-panel-card .k {
  color: rgba(245, 248, 250, 0.62);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 18px;
}
.site-signal-stack {
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.site-signal-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
    rgba(255,255,255,0.025);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 20px 40px rgba(0,0,0,0.18);
}
.site-signal-step {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(131, 215, 255, 0.2), rgba(105, 255, 191, 0.12));
  color: #e5f7ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
}
.site-signal-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.site-signal-copy {
  color: rgba(237, 243, 247, 0.74);
  font-size: 12px;
  line-height: 1.5;
}
.site-checklist {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-checklist li {
  position: relative;
  padding-left: 18px;
  line-height: 1.6;
}
.site-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(226, 185, 95, 0.12);
}
.site-section {
  margin-top: 24px;
  padding: 0;
}
.site-section-head {
  max-width: 720px;
  margin-bottom: 14px;
}
.site-section-head h2 {
  margin: 16px 0 12px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.06;
  letter-spacing: -0.05em;
  font-family: var(--font-display);
  color: #f4fbff;
}
.site-section-head p {
  margin: 0;
  color: rgba(219, 231, 244, 0.7);
  line-height: 1.6;
}
.site-card-grid,
.site-two-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.site-card {
  padding: 24px;
  background: rgba(10, 18, 29, 0.76);
  backdrop-filter: blur(12px);
}
.site-card h3,
.site-pricing-title {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-family: var(--font-display);
  color: #f4fbff;
}
.site-card p,
.site-pricing-copy {
  margin: 0;
  color: rgba(219, 231, 244, 0.68);
  line-height: 1.6;
}
.site-pricing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(88, 162, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(9,17,29,0.9), rgba(10,18,29,0.96));
}

.site-contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgba(112, 241, 226, 0.16);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(112, 241, 226, 0.13), transparent 42%),
    rgba(255, 255, 255, 0.045);
}

.site-contact-card h2 {
  margin: 12px 0 10px;
  color: #f6fbff;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 56px);
  letter-spacing: -0.07em;
}

.site-contact-card p {
  max-width: 760px;
  margin: 0;
  color: rgba(219, 231, 244, 0.72);
  font-size: 16px;
  line-height: 1.65;
}

.site-contact-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.site-contact-actions a {
  text-decoration: none;
}

.site-contact-email {
  color: rgba(143, 212, 255, 0.92);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-inline-cta {
  display: inline-flex;
  margin-top: 18px;
  text-decoration: none;
}

.header {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  border-top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 120;
  box-shadow: 0 12px 30px rgba(16, 32, 51, 0.05);
}
.logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-family: var(--font-body);
}
.logo span {
  color: var(--text2);
  font-weight: 600;
}
.logo-sep { color: var(--border3); }
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo {
  height: 30px;
  width: 30px;
  object-fit: contain;
  position: static;
  transform: none;
}
.version-badge {
  display: none;
}
.user-chip {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  min-width: 0;
}
.user-chip .name { font-size: 13px; font-weight: 700; }
.user-chip .meta { margin-top: 2px; color: var(--text3); font-size: 11px; }

.main-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 8px 24px 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 72px;
  z-index: 115;
  scrollbar-width: none;
}
.main-tabs::-webkit-scrollbar { display: none; }
.factory-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 125px;
  z-index: 111;
}
.factory-tab {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
}
.factory-tab.active {
  color: #ffffff;
  border-color: #2d6fba;
  background: linear-gradient(135deg, #2d6fba, #1c4f88);
  box-shadow: 0 12px 24px rgba(32, 94, 166, 0.24);
}
.nav-item {
  padding: 12px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  border-bottom: 1px solid transparent;
  margin-bottom: 8px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: 14px 14px 0 0;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.main-tabs .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-item strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.nav-prefix { display: none; }
.nav-label {
  display: inline-block;
  transform: translateY(1px);
}
.nav-item .nav-copy { display: none; }
.nav-item.active {
  color: var(--accent);
  border-color: var(--border);
  border-bottom-color: rgba(255,255,255,0.92);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 -8px 24px rgba(16, 32, 51, 0.03);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky;
  top: 177px;
  z-index: 110;
}
.search-inline { display:flex; align-items:center; gap:6px; }
.search-box {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  width: 280px;
  outline: none;
  font-family: var(--font-body);
}
.search-box::placeholder { color: var(--text3); }
.search-clear {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 12px;
}
.toolbar-meta {
  color: var(--text3);
  font-size: 12px;
  line-height: 1.4;
  font-family: var(--font-body);
  letter-spacing: 0;
}
.toolbar-spacer { flex: 1; }
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar-actions .primary,
.toolbar-actions .secondary {
  white-space: nowrap;
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.84);
}
.segmented button {
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border2);
}
.segmented button:last-child { border-right: 0; }
.segmented button.is-active {
  color: var(--accent);
  background: rgba(32, 94, 166, 0.08);
}

.stats-bar { display: none !important; }
.orders-pager {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 202px;
  z-index: 105;
}
.orders-pager-meta {
  color: var(--text2);
  font-size: 12px;
}
.orders-pager-actions,
.orders-pager-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.orders-pager-page {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}
.orders-pager-select {
  background: rgba(17, 23, 17, 0.98);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  font-size: 11px;
  font-family: var(--font-mono);
}
.stat {
  flex: 1;
  min-width: 94px;
  background: var(--bg2);
  padding: 10px 12px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.stat-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 2px;
  font-family: var(--font-mono);
}
.stat-val {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}

.content-shell { padding: 18px 20px 28px; }
.view-header {
  margin-bottom: 14px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}
.view-header h2 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.05em;
  text-transform: none;
  font-family: var(--font-display);
}
.view-header p { margin: 0; color: var(--text2); font-size: 14px; }
.view { display: none; }
.view.active { display: block; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}
.panel {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.panel-top-gap { margin-top: 18px; }
.panel h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  font-family: var(--font-body);
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric {
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(244,248,252,0.94));
  border: 1px solid var(--border);
}
.metric .label {
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
}
.metric .value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  font-family: var(--font-display);
}
.list {
  display: grid;
  gap: 12px;
}
.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(145, 163, 184, 0.14);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table th {
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(246,249,252,0.94), rgba(239,244,249,0.94));
  position: sticky;
  top: 0;
  z-index: 1;
  font-family: var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.data-table tbody tr:hover {
  background: rgba(32, 94, 166, 0.04);
}
.data-table tbody tr:nth-child(even) {
  background: rgba(246,249,252,0.62);
}
.cell-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.cell-sub, .cell-note {
  color: var(--text2);
  font-size: 12px;
  line-height: 1.45;
}
.stock-cell {
  min-width: 220px;
  white-space: normal !important;
}
.stock-primary {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.stock-breakdown {
  margin-top: 4px;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}
.stock-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.stock-hint {
  color: var(--text3);
  font-size: 11px;
  line-height: 1.35;
}
.data-table td .tag {
  white-space: nowrap;
}
.cell-note {
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cell-sub {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empty-cell {
  color: var(--text2);
  text-align: center;
  padding: 18px;
  background: #fafbfd;
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.table-action {
  padding: 6px 8px;
  font-size: 10px;
}
.table-action-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.list-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border2);
}
.list-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}
.list-meta {
  color: var(--text2);
  font-size: 11px;
  line-height: 1.55;
}
.invoice-blocker {
  border-color: rgba(220, 38, 38, 0.22);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.92));
}
.invoice-blocker .list-title {
  color: #991b1b;
}
.invoice-blocker-actions {
  margin-top: 10px;
}

.notice {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text2);
  font-size: 14px;
  line-height: 1.55;
}
.notice.error {
  color: #f1d4ca;
  border-color: rgba(180,106,85,0.45);
  background: rgba(63,30,22,0.62);
}
.notice.success {
  color: #dae9d2;
  border-color: rgba(127,168,111,0.4);
  background: rgba(22, 48, 26, 0.56);
}
.notice.info {
  color: #d9ddcf;
  border-color: rgba(113,128,142,0.35);
  background: rgba(28, 35, 31, 0.8);
}
.shipment-card {
  display: grid;
  gap: 10px;
}
.shipment-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.shipment-left {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.shipment-left input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
}
.shipment-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-grid, .activity-list {
  display: grid;
  gap: 12px;
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-meta {
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.compact-list {
  gap: 8px;
}
.kv-list {
  display: grid;
  gap: 10px;
}
.kv-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(245, 249, 252, 0.92);
  border: 1px solid var(--border2);
}
.kv-key {
  color: var(--text2);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.kv-value {
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}
.status-card, .activity-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border2);
}
.status-top, .activity-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.status-title, .activity-title {
  font-weight: 700;
  font-size: 14px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border2);
  font-family: var(--font-body);
}
.tag.yes, .tag.active, .tag.shell-ready { color: #285d41; background: #edf7f0; }
.tag.next, .tag.next-slice, .tag.planned { color: #6f5620; background: #fbf4e2; }
.tag.partial { color: #3d5368; background: #edf3f8; }
.tag.gray,
.tag.pending {
  color: #8a6117;
  background: #fff4d7;
  border-color: #eccf7f;
  box-shadow: 0 0 0 1px rgba(236, 207, 127, 0.22), 0 0 18px rgba(215, 180, 104, 0.18);
}
.tag.yellow,
.tag.shipped,
.tag.delivered {
  color: #1f6b49;
  background: #eaf8ee;
  border-color: #8fd0a6;
  box-shadow: 0 0 0 1px rgba(143, 208, 166, 0.2), 0 0 18px rgba(98, 192, 133, 0.16);
}
.tag.invoiced,
.tag.invoice,
.tag.blue,
.tag.review {
  color: #365a82;
  background: #edf5ff;
  border-color: #a9c5e8;
  box-shadow: 0 0 0 1px rgba(169, 197, 232, 0.2), 0 0 18px rgba(127, 166, 209, 0.16);
}
.tag.red,
.tag.problem,
.tag.blocked {
  color: #8f3c2f;
  background: #fdebe7;
  border-color: #e5aa9d;
  box-shadow: 0 0 0 1px rgba(229, 170, 157, 0.22), 0 0 18px rgba(208, 122, 105, 0.16);
}
.tag.gr-confirmed,
.tag.gr-ok {
  color: #245f49;
  background: #e8f9f0;
  border-color: #84d2af;
  box-shadow: 0 0 0 1px rgba(132, 210, 175, 0.2), 0 0 18px rgba(98, 192, 133, 0.14);
}
.tag.archived {
  color: #6b7680;
  background: #eef2f5;
  border-color: #d3dbe2;
}
.tag.in-transit {
  color: #87520f;
  background: #fff1dd;
  border-color: #edc07a;
  box-shadow: 0 0 0 1px rgba(237, 192, 122, 0.22), 0 0 18px rgba(217, 161, 90, 0.16);
}
.tag.received,
.tag.received-poland {
  color: #1f6b49;
  background: #eaf8ee;
  border-color: #8fd0a6;
  box-shadow: 0 0 0 1px rgba(143, 208, 166, 0.2), 0 0 18px rgba(98, 192, 133, 0.16);
}
.activity-meta, code {
  color: var(--accent);
  font-family: var(--font-mono);
}
.activity-detail { color: var(--text2); font-size: 13px; line-height: 1.6; }

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(14, 24, 38, 0.18);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-card {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid var(--border3);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
  padding: 24px;
}
.modal-wide { width: min(1320px, 100%); }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: -24px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}
.modal-head h3 {
  margin: 10px 0 0;
  font-size: 26px;
  letter-spacing: -0.03em;
  font-family: var(--font-display);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-actions.split {
  justify-content: space-between;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.checkbox-inline input {
  width: auto;
  margin: 0;
}
.settings-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.settings-module-grid .checkbox-inline {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.74);
  border: 1px solid var(--border);
}
.import-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.import-meta-card {
  border: 1px solid var(--border);
  background: #f7f9fb;
  border-radius: 8px;
  padding: 12px 14px;
}
.import-meta-card .k {
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.import-meta-card .v {
  font-size: 15px;
  font-weight: 700;
}
.import-modal-pdf .modal-card {
  width: min(1120px, 100%);
  padding: 16px 18px;
}
.import-modal-pdf .modal-head {
  top: -16px;
  margin-bottom: 10px;
  padding-bottom: 10px;
}
.import-modal-pdf .modal-head h3 {
  margin-top: 4px;
  font-size: 18px;
}
.import-modal-pdf .eyebrow {
  padding: 5px 8px;
  font-size: 10px;
}
.import-modal-pdf .import-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.import-modal-pdf .import-meta-card {
  padding: 9px 11px;
}
.import-modal-pdf .import-meta-card .k {
  margin-bottom: 4px;
  font-size: 11px;
}
.import-modal-pdf .import-meta-card .v {
  font-size: 14px;
}
.import-modal-pdf .notice {
  margin-top: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}
.import-preview-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.2fr);
  gap: 18px;
}
.import-modal-pdf .import-preview-shell {
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
}
.import-modal-pdf .panel {
  padding: 10px;
}
.import-modal-pdf .panel h3 {
  margin-bottom: 8px;
  font-size: 13px;
}
.compact-table th,
.compact-table td {
  padding: 8px 10px;
  vertical-align: top;
}
.compact-table input,
.compact-table select {
  width: 100%;
  min-width: 74px;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.compact-table textarea {
  width: 100%;
  min-width: 180px;
  min-height: 56px;
  resize: vertical;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px;
}
.checkbox-cell { text-align: center; }
.import-row-skipped { opacity: 0.58; }
.import-help {
  color: var(--text2);
  font-size: 12px;
  line-height: 1.55;
}
.import-static {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
}
.import-static-strong {
  font-weight: 700;
}
.import-static-description {
  max-width: 320px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.import-lane-cell select {
  min-width: 68px;
}
.import-table-wrap {
  max-height: 56vh;
}
.import-modal-pdf .import-table-wrap {
  max-height: 320px;
}
.import-modal-pdf .compact-table th,
.import-modal-pdf .compact-table td {
  padding: 6px 8px;
}
.import-table-wrap .data-table th {
  top: 0;
}
.import-table-wrap .data-table td {
  vertical-align: top;
}
.import-table-wrap .data-table input,
.import-table-wrap .data-table textarea,
.import-table-wrap .data-table select {
  background: #fff;
}
.import-table-wrap .data-table input[readonly],
.import-table-wrap .data-table textarea[readonly],
.import-table-wrap .data-table select:disabled {
  color: var(--text2);
  opacity: 0.92;
  cursor: default;
  border-color: rgba(255,255,255,0.05);
}
.panel-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head-inline h3 {
  margin: 0;
}
.import-modal-pdf .panel-head-inline {
  margin-bottom: 8px;
}
.import-modal-pdf .field-help {
  font-size: 11px;
}

#importModal .modal-card {
  width: min(1680px, calc(100vw - 64px));
  height: min(920px, calc(100vh - 64px));
  max-height: calc(100vh - 64px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#importModal .modal-head {
  position: static;
  flex: 0 0 auto;
}

#importModal .import-meta {
  flex: 0 0 auto;
}

#importModal .notice {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.import-bulk-bar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(160px, 0.26fr) minmax(360px, 1fr) minmax(220px, 0.36fr);
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(245, 249, 252, 0.94);
}

.import-bulk-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.import-bulk-copy,
.import-bulk-help {
  color: var(--text2);
  font-size: 12px;
  line-height: 1.35;
}

.import-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.import-bulk-actions .table-action {
  min-height: 32px;
  padding: 7px 10px;
}

.import-bulk-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

#importModal .import-preview-shell,
#importModal #importStandardSection {
  flex: 1 1 auto;
  min-height: 0;
}

#importModal #importStandardSection {
  display: flex;
  flex-direction: column;
}

#importModal .import-preview-shell .panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#importModal .panel-head-inline {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

#importModal .pdf-preview-pane,
#importModal .pdf-preview-frame,
#importModal .preview-empty {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
}

#importModal .import-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#importModal .modal-actions {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

#importModal .data-table {
  table-layout: fixed;
}

#importModal .compact-table th,
#importModal .compact-table td {
  padding: 6px 8px;
}

#importPdfPreviewSection .compact-table th:nth-child(1),
#importRows td:nth-child(1) { width: 58px; }
#importPdfPreviewSection .compact-table th:nth-child(2),
#importRows td:nth-child(2) { width: 82px; }
#importPdfPreviewSection .compact-table th:nth-child(3),
#importRows td:nth-child(3) { width: 112px; }
#importPdfPreviewSection .compact-table th:nth-child(5),
#importRows td:nth-child(5) { width: 70px; }
#importPdfPreviewSection .compact-table th:nth-child(6),
#importRows td:nth-child(6) { width: 86px; }

#importRows .import-static-description {
  max-width: none;
  -webkit-line-clamp: 2;
}

#importModal .compact-table select,
#importModal .compact-table input {
  min-height: 34px;
}

#importModal .compact-table textarea {
  min-height: 44px;
  max-height: 72px;
}

@media (max-width: 1100px) {
  #importModal .modal-card {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
    padding: 14px;
  }

  .import-bulk-bar {
    grid-template-columns: 1fr;
  }

  .import-bulk-divider {
    display: none;
  }
}

.order-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.order-line-description {
  min-width: 220px;
}
.order-line-total {
  min-height: 40px;
  display: flex;
  align-items: center;
  color: var(--text);
  font-weight: 700;
}
.order-line-row .table-action {
  white-space: nowrap;
}
.order-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}
.order-preview-selected {
  display: grid;
  gap: 14px;
}
.preview-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.preview-line-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}
.preview-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.preview-detail-grid > div {
  display: grid;
  gap: 4px;
}
.preview-k {
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
}
.preview-v {
  color: var(--text);
  font-weight: 600;
}
.preview-note {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
}
.preview-row-active {
  background: rgba(191, 161, 74, 0.12);
}
.pdf-preview-pane {
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f7f9fb;
  overflow: hidden;
}
.import-modal-pdf .pdf-preview-pane {
  min-height: 300px;
  max-height: 300px;
}
.pdf-preview-frame {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 0;
  background: #fff;
}
.import-modal-pdf .pdf-preview-frame {
  min-height: 300px;
}
.preview-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--text2);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
.import-modal-pdf .preview-empty {
  min-height: 300px;
}
.warehouse-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-row-span-2 {
  grid-column: span 2;
}
.catalog-media-card {
  border: 1px solid var(--border);
  background: #f7f9fb;
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.catalog-media-preview {
  min-height: 180px;
  border: 1px dashed var(--border2);
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.catalog-media-image {
  display: block;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}
.catalog-media-placeholder,
.field-help {
  color: var(--text2);
  font-size: 12px;
  line-height: 1.55;
}
.catalog-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.catalog-thumb-wrap {
  display: flex;
  align-items: center;
  min-height: 52px;
}
.catalog-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.catalog-suggestion-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 249, 255, 0.9));
}
.warehouse-form-grid .form-row:last-child {
  grid-column: 1 / -1;
}

#appView {
  min-height: 100vh;
}

.app-grid {
  min-height: calc(100vh - 104px);
  display: block;
}

.workspace-stage {
  min-width: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
}

.table-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.table-link:hover,
.table-link:focus-visible {
  color: #825d14;
  text-decoration: underline;
}

.order-row-clickable {
  cursor: pointer;
}

.order-row-clickable:hover td {
  background: rgba(32, 94, 166, 0.04);
}

.workspace-stage .toolbar,
.workspace-stage .factory-tabs,
.workspace-stage .stats-bar,
.workspace-stage .orders-pager {
  position: static;
}

.workspace-stage .toolbar {
  min-height: 64px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.workspace-stage .toolbar-meta { display: none; }

.workspace-stage .search-inline {
  order: 0;
  justify-self: stretch;
}

.workspace-stage .search-box {
  width: 100%;
}

.workspace-stage .toolbar-spacer {
  display: none;
}

.workspace-stage .toolbar-actions {
  order: 1;
  justify-self: end;
}

.workspace-stage .factory-tabs {
  padding: 10px 18px;
  gap: 8px;
}

.workspace-stage .stats-bar {
  padding: 0 16px;
  gap: 8px;
  background: transparent;
  border-bottom: 0;
}

.workspace-stage .stat {
  border: 1px solid var(--border2);
  border-radius: 10px;
}

.workspace-stage .orders-pager {
  margin: 8px 18px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.7);
}

.workspace-stage .content-shell {
  min-width: 0;
  padding: 18px 18px 24px;
}

.workspace-stage .view-header {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.workspace-stage .panel { border-radius: 20px; }

.workspace-stage .panel,
.workspace-stage .table-wrap {
  min-width: 0;
  max-width: 100%;
}

.workspace-stage .summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-stage .metric .value {
  font-size: 18px;
}

.workspace-stage .data-table th {
  font-size: 10px;
}

.workspace-stage .data-table td {
  font-size: 12px;
  line-height: 1.45;
}

.workspace-stage .status-card,
.workspace-stage .activity-item,
.workspace-stage .kv-item,
.workspace-stage .import-meta-card,
.workspace-stage .metric {
  border-radius: 18px;
}

.summary-panel {
  display: none;
}

.hidden.summary-panel {
  display: none !important;
}

body[data-theme="dark"] .login-card,
body[data-theme="dark"] .login-form-wrap,
body[data-theme="dark"] .header,
body[data-theme="dark"] .main-tabs,
body[data-theme="dark"] .factory-tabs,
body[data-theme="dark"] .toolbar,
body[data-theme="dark"] .orders-pager,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .notice,
body[data-theme="dark"] .status-card,
body[data-theme="dark"] .activity-item,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .modal-head,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .import-meta-card,
body[data-theme="dark"] .catalog-media-card,
body[data-theme="dark"] .pdf-preview-pane,
body[data-theme="dark"] .catalog-media-preview,
body[data-theme="dark"] .preview-empty {
  background: var(--panel);
  color: var(--text);
}

body[data-theme="dark"] .public-site,
body[data-theme="dark"] .login-shell {
  background:
    radial-gradient(circle at top left, rgba(115, 178, 255, 0.12), transparent 30%),
    radial-gradient(circle at right 10%, rgba(242, 190, 97, 0.06), transparent 18%),
    linear-gradient(180deg, #09111d 0%, #0b1320 56%, #101928 100%);
}

body[data-theme="dark"] .site-header,
body[data-theme="dark"] .site-section-alt,
body[data-theme="dark"] .site-card,
body[data-theme="dark"] .site-pricing-card,
body[data-theme="dark"] .site-hero-copy,
body[data-theme="dark"] .site-strip-card {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
}

body[data-theme="dark"] .site-hero-panel {
  background:
    radial-gradient(circle at top left, rgba(115, 178, 255, 0.14), transparent 36%),
    linear-gradient(165deg, rgba(8, 16, 28, 0.98), rgba(12, 22, 37, 0.98));
}
body[data-theme="dark"] .login-signal-card,
body[data-theme="dark"] .site-signal-card {
  border-color: rgba(115, 178, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
    rgba(255,255,255,0.02);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .search-box,
body[data-theme="dark"] .search-clear,
body[data-theme="dark"] .secondary,
body[data-theme="dark"] .factory-tab,
body[data-theme="dark"] .segmented,
body[data-theme="dark"] .version-badge {
  background: rgba(11, 20, 33, 0.88);
  color: var(--text);
  border-color: var(--border2);
}

body[data-theme="dark"] .primary {
  background: linear-gradient(135deg, #5da8ff, #2e72c2);
  color: #f5f9ff;
}

body[data-theme="dark"] .factory-tab.active,
body[data-theme="dark"] .segmented button.is-active,
body[data-theme="dark"] .nav-item.active {
  background: rgba(115, 178, 255, 0.12);
  color: #d9ecff;
  border-color: rgba(115, 178, 255, 0.24);
  border-bottom-color: rgba(15, 25, 39, 0.9);
}

body[data-theme="dark"] .data-table th {
  background: linear-gradient(180deg, rgba(20,32,49,0.96), rgba(15,25,39,0.98));
}

body[data-theme="dark"] .data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

body[data-theme="dark"] .data-table tbody tr:hover,
body[data-theme="dark"] .order-row-clickable:hover td {
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .empty-cell {
  background: rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] .tag.yes,
body[data-theme="dark"] .tag.active,
body[data-theme="dark"] .tag.shell-ready,
body[data-theme="dark"] .tag.yellow,
body[data-theme="dark"] .tag.shipped,
body[data-theme="dark"] .tag.delivered,
body[data-theme="dark"] .tag.received,
body[data-theme="dark"] .tag.received-poland,
body[data-theme="dark"] .tag.gr-confirmed,
body[data-theme="dark"] .tag.gr-ok {
  color: #dcfee7;
  background: rgba(40, 154, 87, 0.18);
  border-color: rgba(98, 192, 133, 0.38);
  box-shadow: 0 0 0 1px rgba(98, 192, 133, 0.18), 0 0 18px rgba(98, 192, 133, 0.18);
}

body[data-theme="dark"] .tag.gray,
body[data-theme="dark"] .tag.pending,
body[data-theme="dark"] .tag.next,
body[data-theme="dark"] .tag.next-slice,
body[data-theme="dark"] .tag.planned,
body[data-theme="dark"] .tag.in-transit {
  color: #ffe8b1;
  background: rgba(195, 144, 45, 0.18);
  border-color: rgba(226, 185, 95, 0.36);
  box-shadow: 0 0 0 1px rgba(226, 185, 95, 0.16), 0 0 18px rgba(226, 185, 95, 0.16);
}

body[data-theme="dark"] .tag.blue,
body[data-theme="dark"] .tag.review,
body[data-theme="dark"] .tag.invoiced,
body[data-theme="dark"] .tag.invoice,
body[data-theme="dark"] .tag.partial {
  color: #dbeafe;
  background: rgba(72, 119, 175, 0.18);
  border-color: rgba(127, 166, 209, 0.36);
  box-shadow: 0 0 0 1px rgba(127, 166, 209, 0.16), 0 0 18px rgba(127, 166, 209, 0.16);
}

body[data-theme="dark"] .tag.red,
body[data-theme="dark"] .tag.problem,
body[data-theme="dark"] .tag.blocked {
  color: #ffe0d9;
  background: rgba(160, 75, 55, 0.22);
  border-color: rgba(208, 122, 105, 0.36);
  box-shadow: 0 0 0 1px rgba(208, 122, 105, 0.16), 0 0 18px rgba(208, 122, 105, 0.16);
}

#view-poland .repair-summary-panel {
  display: block;
}

#view-poland .summary-grid {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

#view-poland .repair-flag {
  margin: 6px 4px 0 0;
}

#view-poland .clamp-text {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#technicalCardModal .modal-card,
#polandShipmentModal .modal-card {
  max-height: min(92vh, 1040px);
  overflow: auto;
}

#technicalCardModal .metric-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.repair-technical-card-panel .warehouse-form-grid {
  align-items: end;
}

.repair-checkbox-row {
  min-height: 72px;
  justify-content: center;
}

.repair-checkbox-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.repair-card-notes-row {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .repair-card-notes-row {
    grid-column: auto;
  }
}

.repair-attachments-panel .panel-heading-row,
.repair-attachment-controls,
.repair-attachment-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.repair-attachments-panel .panel-heading-row {
  justify-content: space-between;
  align-items: flex-start;
}

.repair-attachment-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.repair-attachment-controls input[type="file"] {
  max-width: 280px;
}

.repair-attachments-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.repair-attachment-card {
  align-items: stretch;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: var(--bg3);
}

.repair-attachment-card img,
.repair-document-icon {
  width: 72px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--panel-strong);
}

.repair-document-icon {
  display: grid;
  place-items: center;
  color: var(--text2);
  font-weight: 800;
  letter-spacing: .08em;
}

.repair-attachment-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
}

.repair-attachment-copy a,
.repair-attachment-copy strong,
.repair-attachment-copy span,
.repair-attachment-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repair-attachment-copy span,
.repair-attachment-copy small {
  color: var(--text2);
}

body[data-theme="dark"] #technicalCardModal .activity-item,
body[data-theme="dark"] #technicalCardModal .status-card,
body[data-theme="dark"] #polandShipmentModal .panel {
  color: #e7eef7;
  background: #132337;
  border-color: rgba(151, 174, 199, 0.28);
}

@media (max-width: 920px) {
  #view-poland .summary-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

/* Beta2 clean refresh: simpler hierarchy, stronger contrast, less panel noise. */
:root {
  --bg: #f4f7f6;
  --bg2: #ffffff;
  --bg3: #f8faf9;
  --bg4: #e2e8f0;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --border: rgba(21, 35, 49, 0.10);
  --border2: rgba(21, 35, 49, 0.14);
  --border3: rgba(21, 35, 49, 0.22);
  --text: #13202b;
  --text2: #536271;
  --text3: #7b8794;
  --accent: #0f766e;
  --accent2: #12343b;
  --accent-soft: rgba(15, 118, 110, 0.11);
  --gold: #d97706;
  --green: #059669;
  --red: #c2410c;
  --blue: #2563eb;
  --orange: #ea580c;
  --shadow: 0 14px 38px rgba(15, 23, 42, 0.07);
  --shadow-strong: 0 26px 70px rgba(15, 23, 42, 0.14);
}

body {
  background:
    radial-gradient(circle at 0 0, rgba(15, 118, 110, 0.10), transparent 28%),
    linear-gradient(135deg, #f8faf9 0%, #eef4f2 48%, #f7f4ec 100%);
}

body::before {
  background:
    linear-gradient(rgba(19, 32, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 32, 43, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.72;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
}

.header {
  min-height: 64px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(21, 35, 49, 0.09);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.logo {
  font-size: 14px;
  letter-spacing: 0.01em;
}

.logo span {
  color: #5b6875;
}

.user-chip .name {
  font-size: 12px;
}

.user-chip .meta {
  font-size: 10px;
}

.main-tabs {
  top: 64px;
  gap: 8px;
  padding: 10px 18px 0;
  background: rgba(248, 250, 249, 0.90);
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 rgba(21, 35, 49, 0.08);
}

.nav-item {
  margin-bottom: 10px;
  padding: 10px 13px;
  border-radius: 999px;
  color: #596877;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.nav-item.active {
  color: #073b37;
  background: #dff7ef;
  border-color: rgba(15, 118, 110, 0.24);
  border-bottom-color: rgba(15, 118, 110, 0.24);
  box-shadow: none;
}

.factory-tabs {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.86);
  border-top: 1px solid rgba(21, 35, 49, 0.06);
}

.factory-tab {
  padding: 8px 12px;
  background: #ffffff;
  border-color: rgba(21, 35, 49, 0.11);
  color: #586676;
  font-size: 11px;
}

.factory-tab.active {
  background: #13202b;
  border-color: #13202b;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(19, 32, 43, 0.16);
}

.workspace-stage .toolbar {
  min-height: 70px;
  margin: 14px 18px 0;
  padding: 12px;
  border: 1px solid rgba(21, 35, 49, 0.10);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.search-box {
  min-height: 44px;
  border-radius: 15px;
  background: #f8faf9;
  border-color: rgba(21, 35, 49, 0.12);
  color: #13202b;
}

.search-box:focus {
  background: #ffffff;
  border-color: rgba(15, 118, 110, 0.56);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.segmented {
  border-radius: 15px;
  background: #f6f8f7;
  border-color: rgba(21, 35, 49, 0.11);
}

.segmented button {
  padding: 10px 13px;
}

.segmented button.is-active {
  color: #073b37;
  background: #dff7ef;
}

.primary,
.toolbar-actions .primary,
#toolbarShipmentsExportButton {
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #0e9f6e);
  border: 1px solid rgba(15, 118, 110, 0.34);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.primary:hover,
#toolbarShipmentsExportButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(15, 118, 110, 0.26);
}

.secondary {
  color: #243443;
  background: #ffffff;
  border-color: rgba(21, 35, 49, 0.12);
  box-shadow: none;
}

.secondary:hover {
  border-color: rgba(15, 118, 110, 0.28);
  background: #f8faf9;
}

.workspace-stage .content-shell {
  padding: 18px 18px 30px;
}

.workspace-stage .view-header {
  margin: 0 0 14px;
  padding: 4px 2px 12px;
  border-bottom: 0;
}

.view-header h2 {
  font-size: 30px;
  letter-spacing: -0.055em;
}

.view-header p {
  color: #5f6b78;
}

.panel {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(21, 35, 49, 0.10);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.07);
}

.summary-grid {
  gap: 10px;
}

.metric {
  padding: 13px 15px;
  background: #ffffff;
  border-color: rgba(21, 35, 49, 0.09);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.metric .label {
  color: #647282;
  font-size: 11px;
}

.metric .value {
  margin-top: 5px;
  color: #0f172a;
  font-size: 22px;
}

.table-wrap {
  border-radius: 24px;
  background: #ffffff;
  border-color: rgba(21, 35, 49, 0.10);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.07);
}

.data-table {
  font-size: 13px;
}

.data-table th {
  padding: 12px 14px;
  color: #667483;
  background: #f8faf9;
  border-bottom: 1px solid rgba(21, 35, 49, 0.09);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(21, 35, 49, 0.075);
  color: #1f2933;
}

.data-table tbody tr:nth-child(even) {
  background: #fbfcfb;
}

.data-table tbody tr:hover,
.order-row-clickable:hover td {
  background: #effaf6;
}

.cell-title {
  color: #111827;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.cell-sub,
.cell-note {
  color: #647282;
}

.table-actions {
  gap: 7px;
}

.table-action {
  padding: 7px 10px;
  border-radius: 11px;
  font-size: 10px;
}

.table-action:disabled,
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.tag {
  min-height: 24px;
  padding: 4px 9px;
  border: 0;
  box-shadow: none !important;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tag.pending,
.tag.gray {
  color: #92400e;
  background: #fff7ed;
}

.tag.in-transit {
  color: #9a3412;
  background: #ffedd5;
}

.tag.delivered,
.tag.yellow,
.tag.shipped {
  color: #166534;
  background: #dcfce7;
}

.tag.gr-confirmed,
.tag.gr-ok {
  color: #065f46;
  background: #ccfbf1;
}

.tag.invoiced,
.tag.invoice,
.tag.blue,
.tag.review {
  color: #1d4ed8;
  background: #dbeafe;
}

.tag.archived {
  color: #475569;
  background: #e2e8f0;
}

.notice {
  border-radius: 18px;
  background: #ffffff;
  border-color: rgba(21, 35, 49, 0.10);
  color: #4b5563;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.notice.success {
  color: #064e3b;
  background: #dff7ef;
  border-color: rgba(15, 118, 110, 0.20);
}

.notice.info {
  color: #1e3a8a;
  background: #eaf2ff;
  border-color: rgba(37, 99, 235, 0.18);
}

.notice.error {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.18);
}

body[data-theme="dark"] {
  --bg: #09111d;
  --panel: #101b2a;
  --border: rgba(148, 163, 184, 0.14);
  --border2: rgba(148, 163, 184, 0.20);
  --text: #edf5ff;
  --text2: #b5c4d7;
  --text3: #8a9aae;
}

body[data-theme="dark"] .header,
body[data-theme="dark"] .main-tabs,
body[data-theme="dark"] .factory-tabs,
body[data-theme="dark"] .workspace-stage .toolbar,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .secondary {
  background: rgba(15, 25, 39, 0.92);
  border-color: rgba(148, 163, 184, 0.16);
}

body[data-theme="dark"] .data-table th {
  background: rgba(20, 32, 49, 0.96);
}

body[data-theme="dark"] .data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.018);
}

body[data-theme="dark"] .data-table tbody tr:hover,
body[data-theme="dark"] .order-row-clickable:hover td {
  background: rgba(20, 184, 166, 0.08);
}

@media (max-width: 980px) {
  .app-grid {
    min-height: auto;
  }
  .workspace-stage .toolbar {
    grid-template-columns: 1fr;
    margin: 10px 12px 0;
    padding: 10px;
    gap: 10px;
  }
  .login-card,
  .content-grid,
  .site-hero,
  .site-card-grid,
  .site-two-col { grid-template-columns: 1fr; }
  .hero-grid, .summary-grid { grid-template-columns: 1fr; }
  .site-hero-strip { grid-template-columns: 1fr; }
  .kv-item { grid-template-columns: 1fr; }
  .import-meta { grid-template-columns: 1fr; }
  .warehouse-form-grid { grid-template-columns: 1fr; }
  .order-form-grid { grid-template-columns: 1fr; }
  .order-preview-grid { grid-template-columns: 1fr; }
  .import-preview-shell { grid-template-columns: 1fr; }
  .preview-detail-grid { grid-template-columns: 1fr; }
  .header {
    height: auto;
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
  }
  .logo {
    font-size: 13px;
    line-height: 1.15;
  }
  .header-right {
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
  }
  .header-logo { display: none; }
  .user-chip .meta { display: none; }
  .theme-toggle { min-width: 0; }
  .header-right .secondary {
    padding: 8px 10px;
    border-radius: 12px;
  }
  .main-tabs { padding: 8px 12px 0; top: auto; position: static; }
  .factory-tabs { top: auto; position: static; }
  .workspace-stage .toolbar-actions {
    width: 100%;
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workspace-stage .toolbar-actions .segmented {
    grid-column: 1 / -1;
    width: 100%;
  }
  .workspace-stage .toolbar-actions .segmented button {
    flex: 1;
  }
  .workspace-stage .toolbar-actions .primary,
  .workspace-stage .toolbar-actions .secondary {
    width: 100%;
    justify-content: center;
  }
  .workspace-stage .content-shell {
    padding: 14px 12px 24px;
  }
  .stats-bar { flex-wrap: wrap; padding: 0 16px; }
  .orders-pager { flex-wrap: wrap; margin: 8px 16px 0; }
  .site-header-inner,
  .site-shell { width: min(100% - 28px, 1180px); }
  .site-header-inner { padding: 14px 0; align-items: flex-start; }
  .site-nav { width: 100%; }
  .site-hero-copy,
  .site-hero-panel,
  .site-card,
  .site-pricing-card,
  .login-copy,
  .login-form-wrap { padding: 24px; }
  .site-pricing-card { align-items: flex-start; flex-direction: column; }
  .login-copy { display: flex; }
}

/* Beta2 cockpit polish: a sharper operations app shell without changing workflow. */
:root {
  --app-ink: #08111f;
  --app-ink2: #111c2d;
  --app-paper: #f7faf9;
  --app-surface: rgba(255, 255, 255, 0.88);
  --app-line: rgba(15, 23, 42, 0.10);
  --app-line-strong: rgba(15, 23, 42, 0.16);
  --app-teal: #0f766e;
  --app-teal2: #14b8a6;
  --app-cyan: #22d3ee;
  --app-amber: #f59e0b;
  --app-rose: #ef4444;
}

body {
  background:
    radial-gradient(circle at 12% -8%, rgba(34, 211, 238, 0.20), transparent 30%),
    radial-gradient(circle at 95% 4%, rgba(245, 158, 11, 0.15), transparent 22%),
    linear-gradient(135deg, #f8faf9 0%, #eef6f4 48%, #fbf7ef 100%);
}

body::before {
  background:
    linear-gradient(rgba(8, 17, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 17, 31, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.48;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.60), transparent 78%);
}

#appView:not(.hidden) {
  min-height: 100vh;
}

#appView:not(.hidden) .header {
  min-height: 72px;
  padding: 0 24px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.22), transparent 28%),
    linear-gradient(135deg, #08111f 0%, #101827 56%, #0f2f2d 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 44px rgba(8, 17, 31, 0.20);
}

#appView:not(.hidden) .header::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.50), rgba(20, 184, 166, 0.45), transparent);
  pointer-events: none;
}

#appView:not(.hidden) .logo {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: #ffffff;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  color: #06201f;
  background: linear-gradient(135deg, #67e8f9, #5eead4 55%, #f8fafc);
  box-shadow: 0 14px 34px rgba(34, 211, 238, 0.24);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brand-title {
  color: #f8fafc !important;
  font-size: 14px;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-subtitle {
  color: rgba(226, 232, 240, 0.68) !important;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  white-space: nowrap;
}

#appView:not(.hidden) .header-logo {
  display: none;
}

#appView:not(.hidden) .header-right {
  gap: 10px;
}

#appView:not(.hidden) .user-chip .name {
  color: #ffffff;
}

#appView:not(.hidden) .user-chip .meta {
  color: rgba(226, 232, 240, 0.58);
}

#appView:not(.hidden) .version-badge,
#appView:not(.hidden) .date-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.80);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

#appView:not(.hidden) .header .secondary {
  color: #e5f4f2;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.12);
}

#appView:not(.hidden) .header .secondary:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(34, 211, 238, 0.34);
}

#appView:not(.hidden) .main-tabs {
  top: 72px;
  padding: 12px 24px;
  gap: 10px;
  background: rgba(8, 17, 31, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 34px rgba(8, 17, 31, 0.14);
}

#appView:not(.hidden) .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin: 0;
  padding: 8px 13px;
  border-radius: 14px;
  color: rgba(226, 232, 240, 0.68);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 750;
}

#appView:not(.hidden) .nav-prefix {
  width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: rgba(248, 250, 252, 0.86);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1;
}

#appView:not(.hidden) .nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.085);
}

#appView:not(.hidden) .nav-item.active {
  color: #05201f;
  background: linear-gradient(135deg, #67e8f9, #5eead4);
  border-color: rgba(94, 234, 212, 0.72);
  box-shadow: 0 16px 34px rgba(20, 184, 166, 0.22);
}

#appView:not(.hidden) .nav-item.active .nav-prefix {
  color: #05201f;
  background: rgba(255, 255, 255, 0.52);
}

#appView:not(.hidden) .app-grid {
  min-height: calc(100vh - 126px);
}

#appView:not(.hidden) .workspace-stage {
  background: transparent;
}

#appView:not(.hidden) .workspace-stage .toolbar,
#appView:not(.hidden) .workspace-stage .factory-tabs,
#appView:not(.hidden) .workspace-stage .view-header,
#appView:not(.hidden) .workspace-stage .content-shell {
  width: min(100% - 36px, 1520px);
  margin-left: auto;
  margin-right: auto;
}

#appView:not(.hidden) .workspace-stage .toolbar {
  grid-template-columns: minmax(330px, 1fr) auto;
  margin-top: 14px;
  padding: 14px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.88);
  border-color: var(--app-line);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

#appView:not(.hidden) .search-inline {
  position: relative;
}

#appView:not(.hidden) .search-inline::before {
  content: "⌕";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: #64748b;
  font-size: 17px;
}

#appView:not(.hidden) .search-box {
  min-height: 48px;
  padding-left: 42px;
  border-radius: 18px;
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

#appView:not(.hidden) .search-clear {
  min-height: 42px;
  min-width: 42px;
  border-radius: 15px;
}

#appView:not(.hidden) .toolbar-actions {
  gap: 9px;
}

#appView:not(.hidden) .segmented {
  min-height: 42px;
  border-radius: 17px;
  background: #eef4f3;
  padding: 4px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

#appView:not(.hidden) .segmented button {
  border: 0;
  border-radius: 13px;
  padding: 8px 12px;
  color: #596775;
}

#appView:not(.hidden) .segmented button.is-active {
  color: #06201f;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

#appView:not(.hidden) .primary,
#appView:not(.hidden) .toolbar-actions .primary,
#appView:not(.hidden) #toolbarShipmentsExportButton {
  min-height: 42px;
  border-radius: 16px;
  color: #041a18;
  background: linear-gradient(135deg, #67e8f9, #5eead4);
  border-color: rgba(20, 184, 166, 0.56);
  box-shadow: 0 15px 28px rgba(20, 184, 166, 0.24);
}

#appView:not(.hidden) .secondary,
#appView:not(.hidden) .toolbar-actions .secondary {
  min-height: 42px;
  border-radius: 16px;
  color: #172331;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
}

#appView:not(.hidden) .primary:hover,
#appView:not(.hidden) .secondary:hover {
  transform: translateY(-1px);
}

#appView:not(.hidden) .workspace-stage .factory-tabs {
  margin-top: 12px;
  padding: 0;
  background: transparent;
  border: 0;
}

#appView:not(.hidden) .factory-tab {
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(12px);
}

#appView:not(.hidden) .factory-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #101827, #12343b);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
}

#appView:not(.hidden) .workspace-stage .content-shell {
  padding: 14px 0 36px;
}

#appView:not(.hidden) .workspace-stage .view-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 128px;
  margin-top: 18px;
  margin-bottom: 0;
  padding: 24px 28px;
  overflow: hidden;
  border-radius: 32px;
  color: #ffffff;
  background:
    radial-gradient(circle at 85% 0%, rgba(103, 232, 249, 0.30), transparent 32%),
    radial-gradient(circle at 5% 90%, rgba(245, 158, 11, 0.20), transparent 28%),
    linear-gradient(135deg, #08111f 0%, #12243a 58%, #0f3d39 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 30px 80px rgba(8, 17, 31, 0.18);
}

#appView:not(.hidden) .workspace-stage .view-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.58), transparent 80%);
  pointer-events: none;
}

#appView:not(.hidden) .workspace-stage .view-header::after {
  content: "Clean HEX · Beta2";
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 8px 11px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#appView:not(.hidden) .view-header > div {
  position: relative;
  z-index: 1;
}

#appView:not(.hidden) .view-header h2 {
  color: #ffffff;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

#appView:not(.hidden) .view-header p {
  max-width: 620px;
  margin-top: 10px;
  color: rgba(226, 232, 240, 0.76);
  font-size: 14px;
  line-height: 1.55;
}

#appView:not(.hidden) .panel {
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.09);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
}

#appView:not(.hidden) .panel h3 {
  margin-bottom: 16px;
  color: #13202b;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#appView:not(.hidden) .table-wrap {
  border-radius: 24px;
  border-color: rgba(15, 23, 42, 0.09);
  background: #ffffff;
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.08);
}

#appView:not(.hidden) .data-table {
  border-collapse: separate;
  border-spacing: 0;
}

#appView:not(.hidden) .data-table th {
  padding: 14px 16px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 10px;
  font-weight: 850;
}

#appView:not(.hidden) .data-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.065);
  color: #1f2937;
}

#appView:not(.hidden) .data-table tbody tr:nth-child(even) {
  background: #fbfdfc;
}

#appView:not(.hidden) .data-table tbody tr:hover,
#appView:not(.hidden) .order-row-clickable:hover td {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.10), rgba(34, 211, 238, 0.04));
}

#appView:not(.hidden) .cell-title {
  color: #0f172a;
  font-weight: 800;
}

#appView:not(.hidden) .tag {
  min-height: 25px;
  border-radius: 999px;
  font-weight: 850;
}

#appView:not(.hidden) .table-action {
  border-radius: 13px;
  font-weight: 800;
}

#appView:not(.hidden) .notice {
  border-radius: 22px;
}

@media (prefers-reduced-motion: no-preference) {
  #appView:not(.hidden) .workspace-stage .toolbar,
  #appView:not(.hidden) .workspace-stage .view-header,
  #appView:not(.hidden) .panel {
    animation: beta2-rise 380ms ease both;
  }

  #appView:not(.hidden) .panel {
    animation-delay: 70ms;
  }
}

@keyframes beta2-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body[data-theme="dark"] {
  --app-paper: #09111d;
}

body[data-theme="dark"] #appView:not(.hidden) .header,
body[data-theme="dark"] #appView:not(.hidden) .main-tabs {
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.16), transparent 30%),
    linear-gradient(135deg, #060b14 0%, #0e1726 56%, #0a2826 100%);
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-stage .toolbar,
body[data-theme="dark"] #appView:not(.hidden) .panel,
body[data-theme="dark"] #appView:not(.hidden) .table-wrap {
  background: rgba(12, 20, 32, 0.92);
  border-color: rgba(148, 163, 184, 0.16);
}

body[data-theme="dark"] #appView:not(.hidden) .panel h3,
body[data-theme="dark"] #appView:not(.hidden) .cell-title {
  color: #f8fafc;
}

body[data-theme="dark"] #appView:not(.hidden) .search-box,
body[data-theme="dark"] #appView:not(.hidden) .secondary,
body[data-theme="dark"] #appView:not(.hidden) .toolbar-actions .secondary,
body[data-theme="dark"] #appView:not(.hidden) .segmented,
body[data-theme="dark"] #appView:not(.hidden) .segmented button.is-active {
  color: #e5edf5;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(148, 163, 184, 0.16);
}

body[data-theme="dark"] #appView:not(.hidden) .data-table th {
  color: #a6b6c8;
  background: rgba(20, 32, 49, 0.96);
}

body[data-theme="dark"] #appView:not(.hidden) .data-table td {
  color: #dbe7f2;
}

@media (max-width: 980px) {
  #appView:not(.hidden) .header {
    min-height: 70px;
    padding: 10px 14px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .brand-title {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #appView:not(.hidden) .date-label,
  #appView:not(.hidden) .version-badge,
  #appView:not(.hidden) .user-chip {
    display: none;
  }

  #appView:not(.hidden) .main-tabs {
    position: sticky;
    top: 70px;
    padding: 10px 12px;
  }

  #appView:not(.hidden) .nav-item {
    min-height: 36px;
    padding: 7px 10px;
  }

  #appView:not(.hidden) .nav-prefix {
    display: none;
  }

  #appView:not(.hidden) .workspace-stage .toolbar,
  #appView:not(.hidden) .workspace-stage .factory-tabs,
  #appView:not(.hidden) .workspace-stage .view-header,
  #appView:not(.hidden) .workspace-stage .content-shell {
    width: calc(100% - 24px);
  }

  #appView:not(.hidden) .workspace-stage .toolbar {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  #appView:not(.hidden) .workspace-stage .toolbar-actions {
    width: 100%;
    justify-self: stretch;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  #appView:not(.hidden) .workspace-stage .toolbar-actions::-webkit-scrollbar {
    display: none;
  }

  #appView:not(.hidden) .workspace-stage .toolbar-actions .segmented,
  #appView:not(.hidden) .workspace-stage .toolbar-actions .primary,
  #appView:not(.hidden) .workspace-stage .toolbar-actions .secondary {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #appView:not(.hidden) .workspace-stage .view-header {
    min-height: 116px;
    padding: 20px;
    border-radius: 28px;
  }

  #appView:not(.hidden) .workspace-stage .view-header::after {
    display: none;
  }

  #appView:not(.hidden) .view-header h2 {
    font-size: 38px;
  }
}

/* Beta2 matte refresh: remove decorative gradients in favor of a cleaner B2B app surface. */
:root {
  --matte-bg: #f3f5f2;
  --matte-ink: #0b1020;
  --matte-ink-soft: #172033;
  --matte-panel: #ffffff;
  --matte-panel-2: #f8faf9;
  --matte-line: #dfe5e2;
  --matte-line-strong: #cbd5d1;
  --matte-muted: #64726d;
  --matte-accent: #0f766e;
  --matte-accent-soft: #e3f5f1;
}

body {
  background: var(--matte-bg);
}

body::before {
  display: none;
}

#appView:not(.hidden) .header {
  color: #f8fafc;
  background: var(--matte-ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

#appView:not(.hidden) .header::after {
  left: 0;
  right: 0;
  height: 2px;
  background: var(--matte-accent);
}

.brand-mark {
  color: var(--matte-ink);
  background: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: none;
}

#appView:not(.hidden) .version-badge,
#appView:not(.hidden) .date-label,
#appView:not(.hidden) .header .secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

#appView:not(.hidden) .main-tabs {
  background: var(--matte-ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

#appView:not(.hidden) .nav-item {
  color: #9aa8b7;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

#appView:not(.hidden) .nav-prefix {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.07);
}

#appView:not(.hidden) .nav-item:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.07);
}

#appView:not(.hidden) .nav-item.active {
  color: var(--matte-ink);
  background: #f8fafc;
  border-color: #f8fafc;
  box-shadow: none;
}

#appView:not(.hidden) .nav-item.active .nav-prefix {
  color: #ffffff;
  background: var(--matte-accent);
}

#appView:not(.hidden) .workspace-stage .view-header {
  min-height: 116px;
  color: var(--matte-ink);
  background: var(--matte-panel);
  border: 1px solid var(--matte-line);
  box-shadow: none;
}

#appView:not(.hidden) .workspace-stage .view-header::before {
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--matte-accent);
  mask-image: none;
}

#appView:not(.hidden) .workspace-stage .view-header::after {
  color: var(--matte-accent);
  background: var(--matte-accent-soft);
  border-color: rgba(15, 118, 110, 0.16);
}

#appView:not(.hidden) .view-header h2 {
  color: var(--matte-ink);
  letter-spacing: -0.065em;
}

#appView:not(.hidden) .view-header p {
  color: var(--matte-muted);
}

#appView:not(.hidden) .workspace-stage .toolbar,
#appView:not(.hidden) .panel,
#appView:not(.hidden) .table-wrap {
  background: var(--matte-panel);
  border-color: var(--matte-line);
  box-shadow: none;
}

#appView:not(.hidden) .workspace-stage .toolbar {
  border-radius: 24px;
}

#appView:not(.hidden) .search-box,
#appView:not(.hidden) .segmented,
#appView:not(.hidden) .secondary,
#appView:not(.hidden) .toolbar-actions .secondary {
  background: var(--matte-panel-2);
  border-color: var(--matte-line);
  box-shadow: none;
}

#appView:not(.hidden) .search-box:focus {
  border-color: rgba(15, 118, 110, 0.48);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.10);
}

#appView:not(.hidden) .segmented button.is-active {
  color: var(--matte-accent);
  background: #ffffff;
  box-shadow: none;
}

#appView:not(.hidden) .primary,
#appView:not(.hidden) .toolbar-actions .primary,
#appView:not(.hidden) #toolbarShipmentsExportButton {
  color: #ffffff;
  background: var(--matte-accent);
  border-color: var(--matte-accent);
  box-shadow: none;
}

#appView:not(.hidden) .primary:hover,
#appView:not(.hidden) .toolbar-actions .primary:hover,
#appView:not(.hidden) #toolbarShipmentsExportButton:hover {
  background: #0b625c;
  border-color: #0b625c;
  box-shadow: none;
}

#appView:not(.hidden) .secondary:hover,
#appView:not(.hidden) .toolbar-actions .secondary:hover {
  background: #ffffff;
  border-color: var(--matte-line-strong);
  box-shadow: none;
}

#appView:not(.hidden) .factory-tab {
  background: var(--matte-panel);
  border-color: var(--matte-line);
  box-shadow: none;
}

#appView:not(.hidden) .factory-tab.active {
  color: #ffffff;
  background: var(--matte-ink-soft);
  border-color: var(--matte-ink-soft);
  box-shadow: none;
}

#appView:not(.hidden) .panel h3 {
  color: var(--matte-ink);
}

#appView:not(.hidden) .data-table th {
  background: #f7f9f8;
  border-bottom-color: var(--matte-line);
}

#appView:not(.hidden) .data-table tbody tr:nth-child(even) {
  background: #fbfcfb;
}

#appView:not(.hidden) .data-table tbody tr:hover,
#appView:not(.hidden) .order-row-clickable:hover td {
  background: #eef8f5;
}

body[data-theme="dark"] #appView:not(.hidden) .header,
body[data-theme="dark"] #appView:not(.hidden) .main-tabs {
  background: #050914;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-stage .view-header {
  color: #f8fafc;
  background: #0e1726;
  border-color: rgba(148, 163, 184, 0.18);
}

body[data-theme="dark"] #appView:not(.hidden) .view-header h2 {
  color: #f8fafc;
}

body[data-theme="dark"] #appView:not(.hidden) .view-header p {
  color: #a7b4c4;
}

/* Beta2 operations refresh: restore color hierarchy without decorative gradients. */
:root {
  --ops-bg: #edf4f8;
  --ops-navy: #14375f;
  --ops-navy-2: #0f2b49;
  --ops-blue: #2563a9;
  --ops-blue-soft: #e7f0fb;
  --ops-teal: #0f8a83;
  --ops-teal-soft: #dff5f1;
  --ops-amber: #c68419;
  --ops-amber-soft: #fff3d8;
  --ops-rose: #c95045;
  --ops-rose-soft: #fdecea;
  --ops-ink: #102033;
  --ops-muted: #5b6f84;
  --ops-panel: #fffdf8;
  --ops-panel-cool: #f7fbff;
  --ops-line: #cdd9e5;
  --ops-shadow: 0 18px 44px rgba(20, 55, 95, 0.10);
}

body {
  background: var(--ops-bg);
}

body::before {
  display: block;
  background:
    linear-gradient(90deg, rgba(37, 99, 169, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(37, 99, 169, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.55;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.60), transparent 72%);
}

#appView:not(.hidden) .header {
  color: #ffffff;
  background: var(--ops-navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 34px rgba(15, 43, 73, 0.18);
}

#appView:not(.hidden) .header::after {
  height: 3px;
  background: var(--ops-teal);
}

.brand-mark {
  color: #ffffff;
  background: var(--ops-teal);
  border-color: rgba(255, 255, 255, 0.24);
}

#appView:not(.hidden) .version-badge,
#appView:not(.hidden) .date-label,
#appView:not(.hidden) .header .secondary {
  color: #eaf4ff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

#appView:not(.hidden) .main-tabs {
  background: #f9fbfd;
  border-bottom: 1px solid var(--ops-line);
  box-shadow: 0 12px 28px rgba(20, 55, 95, 0.08);
}

#appView:not(.hidden) .nav-item {
  color: #52677d;
  background: #ffffff;
  border-color: #d9e3ec;
}

#appView:not(.hidden) .nav-prefix {
  color: var(--ops-blue);
  background: var(--ops-blue-soft);
}

#appView:not(.hidden) .nav-item:hover {
  color: var(--ops-navy);
  background: var(--ops-blue-soft);
  border-color: #bfd3ea;
}

#appView:not(.hidden) .nav-item.active {
  color: #ffffff;
  background: var(--ops-blue);
  border-color: var(--ops-blue);
  box-shadow: 0 12px 24px rgba(37, 99, 169, 0.20);
}

#appView:not(.hidden) .nav-item.active .nav-prefix {
  color: var(--ops-blue);
  background: #ffffff;
}

#appView:not(.hidden) .workspace-stage .view-header {
  min-height: 118px;
  color: var(--ops-ink);
  background: #f4f8fc;
  border: 1px solid var(--ops-line);
  box-shadow: var(--ops-shadow);
}

#appView:not(.hidden) .workspace-stage .view-header::before {
  inset: 18px auto 18px 18px;
  width: 8px;
  border-radius: 999px;
  background: var(--ops-teal);
}

#appView:not(.hidden) .workspace-stage .view-header::after {
  color: #0b615c;
  background: var(--ops-teal-soft);
  border-color: rgba(15, 138, 131, 0.24);
}

#appView:not(.hidden) .view-header h2 {
  color: var(--ops-navy);
}

#appView:not(.hidden) .view-header p {
  color: var(--ops-muted);
}

#appView:not(.hidden) .workspace-stage .toolbar {
  background: var(--ops-panel);
  border-color: var(--ops-line);
  box-shadow: var(--ops-shadow);
}

#appView:not(.hidden) .panel,
#appView:not(.hidden) .table-wrap {
  background: var(--ops-panel);
  border-color: var(--ops-line);
  box-shadow: var(--ops-shadow);
}

#appView:not(.hidden) .search-box,
#appView:not(.hidden) .segmented,
#appView:not(.hidden) .secondary,
#appView:not(.hidden) .toolbar-actions .secondary {
  color: var(--ops-ink);
  background: var(--ops-panel-cool);
  border-color: var(--ops-line);
}

#appView:not(.hidden) .segmented button.is-active {
  color: #ffffff;
  background: var(--ops-navy);
}

#appView:not(.hidden) .primary,
#appView:not(.hidden) .toolbar-actions .primary,
#appView:not(.hidden) #toolbarShipmentsExportButton {
  color: #ffffff;
  background: var(--ops-teal);
  border-color: var(--ops-teal);
  box-shadow: 0 12px 22px rgba(15, 138, 131, 0.18);
}

#appView:not(.hidden) .primary:hover,
#appView:not(.hidden) .toolbar-actions .primary:hover,
#appView:not(.hidden) #toolbarShipmentsExportButton:hover {
  background: #0b736d;
  border-color: #0b736d;
}

#appView:not(.hidden) .secondary:hover,
#appView:not(.hidden) .toolbar-actions .secondary:hover {
  background: #ffffff;
  border-color: #aac0d7;
}

#appView:not(.hidden) .factory-tab {
  color: #52677d;
  background: #ffffff;
  border-color: var(--ops-line);
}

#appView:not(.hidden) .factory-tab.active {
  color: #ffffff;
  background: var(--ops-amber);
  border-color: var(--ops-amber);
}

#appView:not(.hidden) .panel h3 {
  color: var(--ops-navy);
}

#appView:not(.hidden) .data-table th {
  color: #47627c;
  background: var(--ops-blue-soft);
  border-bottom-color: #bfd3ea;
}

#appView:not(.hidden) .data-table td {
  color: #1b2938;
}

#appView:not(.hidden) .data-table tbody tr:nth-child(even) {
  background: #f9fcff;
}

#appView:not(.hidden) .data-table tbody tr:hover,
#appView:not(.hidden) .order-row-clickable:hover td {
  background: var(--ops-teal-soft);
}

#appView:not(.hidden) .orders-pager-select {
  color: var(--ops-ink);
  background: #ffffff;
  border: 1px solid var(--ops-line);
  border-radius: 12px;
  padding: 7px 10px;
  min-height: 34px;
}

#appView:not(.hidden) .data-table td:has(.table-actions) {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
}

#appView:not(.hidden) .table-actions {
  flex-wrap: wrap;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}

#appView:not(.hidden) .table-actions .table-action {
  min-height: 32px;
  padding: 6px 8px;
}

#appView:not(.hidden) #view-orders .table-wrap {
  overflow-x: hidden;
}

#appView:not(.hidden) #view-orders .data-table {
  min-width: 0;
  table-layout: fixed;
}

#appView:not(.hidden) #view-orders .data-table th,
#appView:not(.hidden) #view-orders .data-table td {
  padding-left: 10px;
  padding-right: 10px;
}

#appView:not(.hidden) #view-orders .data-table th:nth-child(1),
#appView:not(.hidden) #view-orders .data-table td:nth-child(1) { width: 3%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(2),
#appView:not(.hidden) #view-orders .data-table td:nth-child(2) { width: 16%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(3),
#appView:not(.hidden) #view-orders .data-table td:nth-child(3) { width: 5%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(4),
#appView:not(.hidden) #view-orders .data-table td:nth-child(4) { width: 5%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(5),
#appView:not(.hidden) #view-orders .data-table td:nth-child(5) { width: 8%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(6),
#appView:not(.hidden) #view-orders .data-table td:nth-child(6) { width: 6%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(7),
#appView:not(.hidden) #view-orders .data-table td:nth-child(7) { width: 18%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(8),
#appView:not(.hidden) #view-orders .data-table td:nth-child(8) { width: 8%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(9),
#appView:not(.hidden) #view-orders .data-table td:nth-child(9) { width: 9%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(10),
#appView:not(.hidden) #view-orders .data-table td:nth-child(10) { width: 8%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(11),
#appView:not(.hidden) #view-orders .data-table td:nth-child(11) { width: 4%; }
#appView:not(.hidden) #view-orders .data-table th:nth-child(12),
#appView:not(.hidden) #view-orders .data-table td:nth-child(12) { width: 10%; }

#appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"] {
  overflow: visible;
}

#appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"] .table-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

#appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"] .table-action {
  min-width: 0;
  min-height: 29px;
  padding: 5px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appView:not(.hidden) .tag.pending,
#appView:not(.hidden) .tag.gray {
  color: #77500e;
  background: var(--ops-amber-soft);
  border-color: #ebc574;
}

#appView:not(.hidden) .tag.invoiced,
#appView:not(.hidden) .tag.invoice,
#appView:not(.hidden) .tag.blue,
#appView:not(.hidden) .tag.review {
  color: #1d5288;
  background: var(--ops-blue-soft);
  border-color: #a9c9ed;
}

#appView:not(.hidden) .tag.gr-confirmed,
#appView:not(.hidden) .tag.gr-ok,
#appView:not(.hidden) .tag.delivered,
#appView:not(.hidden) .tag.received,
#appView:not(.hidden) .tag.received-poland {
  color: #0b615c;
  background: var(--ops-teal-soft);
  border-color: #8ed4cb;
}

#appView:not(.hidden) .tag.red,
#appView:not(.hidden) .tag.problem {
  color: #9b332b;
  background: var(--ops-rose-soft);
  border-color: #e5a39d;
}

body[data-theme="dark"] #appView:not(.hidden) .header {
  background: #0a1422;
}

body[data-theme="dark"] #appView:not(.hidden) .main-tabs {
  background: #101b2c;
}

body[data-theme="dark"] #appView:not(.hidden) .nav-item {
  color: #b4c3d3;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.14);
}

body[data-theme="dark"] #appView:not(.hidden) .nav-item.active {
  color: #ffffff;
  background: #2563a9;
  border-color: #2563a9;
}

@media (max-width: 760px) {
  #appView:not(.hidden) #view-orders .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #appView:not(.hidden) #view-orders .data-table,
  #appView:not(.hidden) #view-orders .data-table tbody,
  #appView:not(.hidden) #view-orders .data-table tr,
  #appView:not(.hidden) #view-orders .data-table td {
    display: block;
  }

  #appView:not(.hidden) #view-orders .data-table {
    min-width: 0;
  }

  #appView:not(.hidden) #view-orders .data-table thead {
    display: none;
  }

  #appView:not(.hidden) #view-orders .data-table tbody {
    display: grid;
    gap: 12px;
  }

  #appView:not(.hidden) #view-orders .data-table tr {
    padding: 14px;
    border: 1px solid var(--ops-line);
    border-radius: 22px;
    background: var(--ops-panel);
    box-shadow: 0 14px 30px rgba(20, 55, 95, 0.08);
  }

  #appView:not(.hidden) #view-orders .data-table td {
    max-width: none;
    padding: 8px 0;
    border-bottom: 1px solid rgba(205, 217, 229, 0.62);
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  #appView:not(.hidden) #view-orders .data-table td:not([data-card-role="primary"]):not([data-card-role="wide"]):not([data-card-role="actions"]):not([data-card-role="select"]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  #appView:not(.hidden) #view-orders .data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: #6a7e91;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.10em;
    text-transform: uppercase;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="select"] {
    float: right;
    padding: 0;
    border-bottom: 0;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="select"]::before,
  #appView:not(.hidden) #view-orders .data-table td[data-card-role="primary"]::before,
  #appView:not(.hidden) #view-orders .data-table td[data-card-role="wide"]::before,
  #appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"]::before {
    display: none;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="primary"] {
    padding-top: 0;
    padding-right: 34px;
    border-bottom-color: rgba(37, 99, 169, 0.14);
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="primary"] .table-link {
    color: var(--ops-teal);
    font-size: 14px;
    line-height: 1.3;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="primary"] .cell-sub {
    max-width: none;
    margin-top: 4px;
    white-space: normal;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="wide"] {
    border-radius: 16px;
    padding: 11px 12px;
    background: #f7fbff;
    border: 1px solid rgba(191, 211, 234, 0.82);
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"] {
    padding-bottom: 0;
    border-bottom: 0;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"] .table-actions {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"] .table-actions::-webkit-scrollbar {
    display: none;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"] .table-action {
    flex: 0 0 auto;
  }

  #appView:not(.hidden) #view-shipments .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #appView:not(.hidden) #view-shipments .data-table,
  #appView:not(.hidden) #view-shipments .data-table tbody,
  #appView:not(.hidden) #view-shipments .data-table tr,
  #appView:not(.hidden) #view-shipments .data-table td {
    display: block;
  }

  #appView:not(.hidden) #view-shipments .data-table {
    min-width: 0;
  }

  #appView:not(.hidden) #view-shipments .data-table thead {
    display: none;
  }

  #appView:not(.hidden) #view-shipments .data-table tbody {
    display: grid;
    gap: 12px;
  }

  #appView:not(.hidden) #view-shipments .data-table tr {
    padding: 14px;
    border: 1px solid var(--ops-line);
    border-radius: 22px;
    background: var(--ops-panel);
    box-shadow: 0 14px 30px rgba(20, 55, 95, 0.08);
  }

  #appView:not(.hidden) #view-shipments .data-table td {
    max-width: none;
    padding: 8px 0;
    border-bottom: 1px solid rgba(205, 217, 229, 0.62);
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  #appView:not(.hidden) #view-shipments .data-table td:not([data-card-role="primary"]):not([data-card-role="wide"]):not([data-card-role="actions"]):not([data-card-role="select"]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  #appView:not(.hidden) #view-shipments .data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: #6a7e91;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.10em;
    text-transform: uppercase;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="select"] {
    float: right;
    padding: 0;
    border-bottom: 0;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="select"]::before,
  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="primary"]::before,
  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="wide"]::before,
  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="actions"]::before {
    display: none;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="primary"] {
    padding-top: 0;
    padding-right: 34px;
    border-bottom-color: rgba(37, 99, 169, 0.14);
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="primary"] .cell-title {
    color: var(--ops-teal);
    font-size: 14px;
    line-height: 1.3;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="primary"] .cell-sub {
    max-width: none;
    margin-top: 4px;
    white-space: normal;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="wide"] {
    border-radius: 16px;
    padding: 11px 12px;
    background: #f7fbff;
    border: 1px solid rgba(191, 211, 234, 0.82);
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="actions"] {
    padding-bottom: 0;
    border-bottom: 0;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="actions"] .table-actions {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="actions"] .table-actions::-webkit-scrollbar {
    display: none;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="actions"] .table-action {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  #appView:not(.hidden) #view-orders .data-table tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #appView:not(.hidden) #view-orders .data-table td {
    min-width: 0;
    padding: 0;
    border-bottom: 0;
  }

  #appView:not(.hidden) #view-orders .data-table td:not([data-card-role="primary"]):not([data-card-role="wide"]):not([data-card-role="actions"]):not([data-card-role="select"]) {
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid rgba(205, 217, 229, 0.72);
    border-radius: 13px;
    background: #f8fbff;
  }

  #appView:not(.hidden) #view-orders .data-table td::before {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="select"] {
    position: absolute;
    top: 14px;
    right: 14px;
    float: none;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="primary"],
  #appView:not(.hidden) #view-orders .data-table td[data-card-role="wide"],
  #appView:not(.hidden) #view-orders .data-table td[data-card-role="actions"] {
    grid-column: 1 / -1;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="primary"] {
    min-height: 46px;
    padding-right: 36px;
    padding-bottom: 7px;
  }

  #appView:not(.hidden) #view-orders .data-table td[data-card-role="wide"] {
    padding: 10px 11px;
  }

  #appView:not(.hidden) #view-orders .stock-primary {
    font-size: 13px;
  }

  #appView:not(.hidden) #view-orders .stock-breakdown,
  #appView:not(.hidden) #view-orders .stock-hint,
  #appView:not(.hidden) #view-orders .cell-sub {
    font-size: 11px;
  }

  #appView:not(.hidden) #view-orders .tag {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10px;
  }

  #appView:not(.hidden) #view-shipments .data-table tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #appView:not(.hidden) #view-shipments .data-table td {
    min-width: 0;
    padding: 0;
    border-bottom: 0;
  }

  #appView:not(.hidden) #view-shipments .data-table td:not([data-card-role="primary"]):not([data-card-role="wide"]):not([data-card-role="actions"]):not([data-card-role="select"]) {
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid rgba(205, 217, 229, 0.72);
    border-radius: 13px;
    background: #f8fbff;
  }

  #appView:not(.hidden) #view-shipments .data-table td::before {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="select"] {
    position: absolute;
    top: 14px;
    right: 14px;
    float: none;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="primary"],
  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="wide"],
  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="actions"] {
    grid-column: 1 / -1;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="primary"] {
    min-height: 46px;
    padding-right: 36px;
    padding-bottom: 7px;
  }

  #appView:not(.hidden) #view-shipments .data-table td[data-card-role="wide"] {
    padding: 10px 11px;
  }

  #appView:not(.hidden) #view-shipments .cell-sub {
    font-size: 11px;
  }

  #appView:not(.hidden) #view-shipments .tag {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10px;
  }
}

/* Beta2 color pass: higher contrast operational palette for the app shell. */
:root {
  --ops-bg: #e8eef3;
  --ops-navy: #0b1f36;
  --ops-navy-2: #102a47;
  --ops-blue: #1f5f99;
  --ops-blue-soft: #e2edf8;
  --ops-teal: #0b7c73;
  --ops-teal-soft: #d8f0ec;
  --ops-amber: #b46a12;
  --ops-amber-soft: #fff0cc;
  --ops-rose: #b94238;
  --ops-rose-soft: #fae3df;
  --ops-ink: #0f1f2e;
  --ops-muted: #4f6173;
  --ops-panel: #fffdf7;
  --ops-panel-cool: #f5f9fc;
  --ops-line: #bdcbd9;
  --ops-line-strong: #95a9bd;
  --ops-shadow: 0 18px 44px rgba(11, 31, 54, 0.13);
  --ops-shadow-soft: 0 8px 22px rgba(11, 31, 54, 0.08);
}

body {
  background-color: var(--ops-bg);
}

body::before {
  display: block;
  background-image:
    linear-gradient(rgba(11, 31, 54, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 31, 54, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.42;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 78%);
}

#appView:not(.hidden) {
  color: var(--ops-ink);
}

#appView:not(.hidden) .header {
  background: var(--ops-navy);
  box-shadow: 0 16px 36px rgba(11, 31, 54, 0.22);
}

#appView:not(.hidden) .header::after {
  background: var(--ops-amber);
}

#appView:not(.hidden) .brand-mark {
  color: var(--ops-navy);
  background: #fff5d6;
  border-color: rgba(255, 255, 255, 0.42);
}

#appView:not(.hidden) .version-badge,
#appView:not(.hidden) .date-label,
#appView:not(.hidden) .header .secondary {
  color: #f7fbff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.24);
}

#appView:not(.hidden) .main-tabs {
  background: rgba(255, 253, 247, 0.96);
  border-bottom-color: var(--ops-line-strong);
  box-shadow: 0 14px 30px rgba(11, 31, 54, 0.10);
}

#appView:not(.hidden) .nav-item {
  color: var(--ops-muted);
  background: #ffffff;
  border-color: var(--ops-line);
  box-shadow: 0 1px 0 rgba(11, 31, 54, 0.04);
}

#appView:not(.hidden) .nav-prefix {
  color: var(--ops-blue);
  background: var(--ops-blue-soft);
}

#appView:not(.hidden) .nav-item:hover {
  color: var(--ops-navy);
  background: #edf5fd;
  border-color: var(--ops-blue);
}

#appView:not(.hidden) .nav-item.active {
  color: #ffffff;
  background: var(--ops-blue);
  border-color: var(--ops-blue);
  box-shadow: 0 14px 28px rgba(31, 95, 153, 0.24);
}

#appView:not(.hidden) .nav-item.active .nav-prefix {
  color: var(--ops-blue);
  background: #ffffff;
}

#appView:not(.hidden) .workspace-stage .view-header {
  color: var(--ops-ink);
  background: var(--ops-panel);
  border-color: var(--ops-line);
  box-shadow: var(--ops-shadow);
}

#appView:not(.hidden) .workspace-stage .view-header::before {
  background: var(--ops-teal);
}

#appView:not(.hidden) .workspace-stage .view-header::after {
  color: #075d57;
  background: var(--ops-teal-soft);
  border-color: rgba(11, 124, 115, 0.28);
}

#appView:not(.hidden) .view-header h2,
#appView:not(.hidden) .panel h3,
#appView:not(.hidden) .metric .value,
#appView:not(.hidden) .cell-title,
#appView:not(.hidden) .list-title {
  color: var(--ops-navy);
}

#appView:not(.hidden) .view-header p,
#appView:not(.hidden) .cell-sub,
#appView:not(.hidden) .list-meta,
#appView:not(.hidden) .toolbar-meta,
#appView:not(.hidden) .muted {
  color: var(--ops-muted);
}

#appView:not(.hidden) .workspace-stage .toolbar,
#appView:not(.hidden) .workspace-stage .factory-tabs,
#appView:not(.hidden) .workspace-stage .content-shell,
#appView:not(.hidden) .panel,
#appView:not(.hidden) .table-wrap,
#appView:not(.hidden) .status-card,
#appView:not(.hidden) .activity-item,
#appView:not(.hidden) .kv-item,
#appView:not(.hidden) .import-meta-card,
#appView:not(.hidden) .metric,
#appView:not(.hidden) .modal-card {
  background: var(--ops-panel);
  border-color: var(--ops-line);
  box-shadow: var(--ops-shadow-soft);
}

#appView:not(.hidden) .toolbar {
  color: var(--ops-ink);
}

#appView:not(.hidden) input,
#appView:not(.hidden) select,
#appView:not(.hidden) textarea,
#appView:not(.hidden) .search-box,
#appView:not(.hidden) .segmented,
#appView:not(.hidden) .orders-pager-select {
  color: var(--ops-ink);
  background: #ffffff;
  border-color: var(--ops-line-strong);
}

#appView:not(.hidden) input::placeholder,
#appView:not(.hidden) textarea::placeholder {
  color: #8494a5;
}

#appView:not(.hidden) input:focus,
#appView:not(.hidden) select:focus,
#appView:not(.hidden) textarea:focus,
#appView:not(.hidden) .search-box:focus-within {
  border-color: var(--ops-teal);
  box-shadow: 0 0 0 4px rgba(11, 124, 115, 0.14);
}

#appView:not(.hidden) button:focus-visible,
#appView:not(.hidden) a:focus-visible,
#appView:not(.hidden) .nav-item:focus-visible,
#appView:not(.hidden) .factory-tab:focus-visible,
#appView:not(.hidden) .table-action:focus-visible {
  outline: 3px solid rgba(180, 106, 18, 0.38);
  outline-offset: 3px;
}

#appView:not(.hidden) .primary,
#appView:not(.hidden) .toolbar-actions .primary,
#appView:not(.hidden) #toolbarShipmentsExportButton {
  color: #ffffff;
  background: var(--ops-teal);
  border-color: var(--ops-teal);
  box-shadow: 0 12px 24px rgba(11, 124, 115, 0.22);
}

#appView:not(.hidden) .primary:hover,
#appView:not(.hidden) .toolbar-actions .primary:hover,
#appView:not(.hidden) #toolbarShipmentsExportButton:hover {
  background: #086a62;
  border-color: #086a62;
}

#appView:not(.hidden) .secondary,
#appView:not(.hidden) .toolbar-actions .secondary,
#appView:not(.hidden) .table-action {
  color: var(--ops-ink);
  background: var(--ops-panel-cool);
  border-color: var(--ops-line-strong);
}

#appView:not(.hidden) .secondary:hover,
#appView:not(.hidden) .toolbar-actions .secondary:hover,
#appView:not(.hidden) .table-action:hover {
  color: var(--ops-navy);
  background: #ffffff;
  border-color: var(--ops-blue);
}

#appView:not(.hidden) .segmented button {
  color: var(--ops-muted);
}

#appView:not(.hidden) .segmented button.is-active {
  color: #ffffff;
  background: var(--ops-navy);
}

#appView:not(.hidden) .factory-tab {
  color: var(--ops-muted);
  background: #ffffff;
  border-color: var(--ops-line-strong);
}

#appView:not(.hidden) .factory-tab:hover {
  color: var(--ops-navy);
  border-color: var(--ops-amber);
}

#appView:not(.hidden) .factory-tab.active {
  color: #ffffff;
  background: var(--ops-amber);
  border-color: var(--ops-amber);
  box-shadow: 0 12px 22px rgba(180, 106, 18, 0.20);
}

#appView:not(.hidden) .data-table {
  background: var(--ops-panel);
}

#appView:not(.hidden) .data-table th {
  color: var(--ops-navy);
  background: #dceaf6;
  border-bottom-color: var(--ops-line-strong);
}

#appView:not(.hidden) .data-table td {
  color: var(--ops-ink);
  border-bottom-color: rgba(149, 169, 189, 0.34);
}

#appView:not(.hidden) .data-table tbody tr:nth-child(even) {
  background: #f4f9fc;
}

#appView:not(.hidden) .data-table tbody tr:hover,
#appView:not(.hidden) .order-row-clickable:hover td {
  background: #dff3ef;
}

#appView:not(.hidden) .table-link {
  color: #134f86;
}

#appView:not(.hidden) .table-link:hover {
  color: var(--ops-blue);
}

#appView:not(.hidden) .tag.pending,
#appView:not(.hidden) .tag.gray,
#appView:not(.hidden) .tag.awaiting {
  color: #70410a;
  background: var(--ops-amber-soft);
  border-color: #d7a84d;
}

#appView:not(.hidden) .tag.invoiced,
#appView:not(.hidden) .tag.invoice,
#appView:not(.hidden) .tag.blue,
#appView:not(.hidden) .tag.review,
#appView:not(.hidden) .tag.new {
  color: #154c82;
  background: var(--ops-blue-soft);
  border-color: #8fb8df;
}

#appView:not(.hidden) .tag.gr-confirmed,
#appView:not(.hidden) .tag.gr-ok,
#appView:not(.hidden) .tag.delivered,
#appView:not(.hidden) .tag.received,
#appView:not(.hidden) .tag.received-poland,
#appView:not(.hidden) .tag.success {
  color: #075d57;
  background: var(--ops-teal-soft);
  border-color: #79c9bf;
}

#appView:not(.hidden) .tag.red,
#appView:not(.hidden) .tag.problem,
#appView:not(.hidden) .tag.error {
  color: #93312a;
  background: var(--ops-rose-soft);
  border-color: #df978f;
}

#appView:not(.hidden) .notice {
  color: var(--ops-ink);
  background: var(--ops-panel-cool);
  border-color: var(--ops-line-strong);
}

#appView:not(.hidden) .notice.error {
  color: #84251f;
  background: var(--ops-rose-soft);
  border-color: #dd928b;
}

#appView:not(.hidden) .notice.success {
  color: #075d57;
  background: var(--ops-teal-soft);
  border-color: #79c9bf;
}

#appView:not(.hidden) .notice.info {
  color: #154c82;
  background: var(--ops-blue-soft);
  border-color: #8fb8df;
}

#appView:not(.hidden) .invoice-blocker {
  background: var(--ops-rose-soft);
  border-color: #dd928b;
}

#appView:not(.hidden) .invoice-blocker .list-title {
  color: #84251f;
}

body[data-theme="dark"] #appView:not(.hidden) {
  --ops-bg: #081522;
  --ops-panel: #101d2b;
  --ops-panel-cool: #132337;
  --ops-line: rgba(144, 164, 188, 0.18);
  --ops-line-strong: rgba(168, 188, 210, 0.28);
  --ops-ink: #eef5fc;
  --ops-muted: #aec0d2;
}

/* Beta2 B2B login: product-first command center, scoped away from the app shell. */
#loginView.login-shell {
  min-height: 100vh;
  place-items: stretch;
  padding: clamp(18px, 3vw, 38px);
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 10%, rgba(68, 154, 255, 0.14), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(187, 255, 83, 0.10), transparent 22%),
    #07101b;
}

#loginView.login-shell::before {
  background-image:
    linear-gradient(rgba(174, 198, 222, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(174, 198, 222, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.72), rgba(0,0,0,0.18));
  opacity: 1;
}

#loginView.login-shell::after {
  content: "";
  position: fixed;
  inset: auto -8% -42% 42%;
  height: 72%;
  pointer-events: none;
  background: rgba(187, 255, 83, 0.08);
  filter: blur(90px);
  transform: rotate(-8deg);
}

.login-stage {
  width: min(1480px, 100%);
  min-height: calc(100vh - clamp(36px, 6vw, 76px));
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  position: relative;
  z-index: 1;
}

.login-topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border: 1px solid rgba(205, 222, 242, 0.12);
  border-radius: 24px;
  background: rgba(9, 20, 34, 0.72);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.login-logo-lockup {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.login-logo-lockup .hero-logo {
  width: 45px;
  height: 45px;
  filter: none;
}

.login-brand-name {
  color: #f8fbff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(187, 255, 83, 0.22);
  border-radius: 999px;
  color: #eaf5ff;
  background: rgba(187, 255, 83, 0.06);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.login-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #bbff53;
  box-shadow: 0 0 0 7px rgba(187, 255, 83, 0.12);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(390px, 0.65fr);
  gap: 22px;
}

.login-hero,
.login-right-rail {
  min-width: 0;
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(30px, 5vw, 66px);
  border: 1px solid rgba(205, 222, 242, 0.12);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018) 42%, rgba(187, 255, 83, 0.04)),
    rgba(9, 20, 34, 0.76);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  color: #f8fbff;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: "OPERATIONS";
  position: absolute;
  right: -16px;
  top: 28px;
  color: rgba(255, 255, 255, 0.035);
  font-family: var(--font-mono);
  font-size: clamp(54px, 10vw, 144px);
  font-weight: 900;
  letter-spacing: -0.1em;
  pointer-events: none;
}

.login-hero .eyebrow,
.login-form-wrap .eyebrow {
  border-color: rgba(187, 255, 83, 0.18);
  background: rgba(187, 255, 83, 0.075);
  color: #d8ff75;
}

.login-hero h1 {
  max-width: 920px;
  margin: 22px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 108px);
  line-height: 0.88;
  letter-spacing: -0.085em;
}

.login-hero h1 span {
  display: block;
}

.login-hero .hero-copy {
  max-width: 760px;
  color: rgba(235, 244, 255, 0.74);
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.58;
}

.login-integration-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 820px;
}

.login-integration-strip span {
  padding: 9px 11px;
  border: 1px solid rgba(205, 222, 242, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 251, 255, 0.76);
  font-size: 12px;
  font-weight: 850;
}

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

.login-product-card {
  min-height: 156px;
  padding: 20px;
  border: 1px solid rgba(205, 222, 242, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-product-code {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #bbff53;
  color: #07101b;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 14px;
}

.login-product-card h3 {
  margin: 0 0 9px;
  color: #ffffff;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.login-product-card p {
  margin: 0;
  color: rgba(235, 244, 255, 0.64);
  line-height: 1.52;
  font-size: 14px;
}

.login-scale-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.44fr);
  gap: 18px;
  align-items: end;
  padding: 22px;
  border: 1px solid rgba(187, 255, 83, 0.18);
  border-radius: 28px;
  background: rgba(187, 255, 83, 0.055);
}

.login-scale-kicker,
.login-board-kicker,
.login-form-foot {
  color: rgba(235, 244, 255, 0.54);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-scale-panel h2 {
  margin: 8px 0 8px;
  color: #f8fbff;
  font-size: clamp(24px, 2.4vw, 38px);
  letter-spacing: -0.055em;
}

.login-scale-panel p {
  max-width: 800px;
  margin: 0;
  color: rgba(235, 244, 255, 0.66);
  line-height: 1.55;
}

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

.login-scale-grid span {
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
  color: #eff7ff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.login-right-rail {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

.login-command-board,
#loginView .login-form-wrap {
  border: 1px solid rgba(205, 222, 242, 0.13);
  border-radius: 34px;
  background: rgba(244, 249, 255, 0.95);
  color: #07101b;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.26);
}

.login-command-board {
  padding: 22px;
}

.login-board-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.login-board-head h2 {
  margin: 5px 0 0;
  font-size: 27px;
  letter-spacing: -0.055em;
}

.login-board-kicker {
  color: #627187;
}

.login-board-status {
  align-self: start;
  padding: 8px 10px;
  border-radius: 999px;
  background: #07101b;
  color: #bbff53;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.login-board-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid rgba(91, 109, 130, 0.18);
  color: #5f6e83;
}

.login-board-row strong {
  color: #07101b;
  text-align: right;
  max-width: 190px;
}

.login-board-row.active strong {
  color: #176342;
}

#loginView .login-form-wrap {
  min-height: 430px;
  padding: clamp(26px, 3.2vw, 42px);
  justify-content: flex-start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 245, 251, 0.96));
  backdrop-filter: blur(18px);
}

#loginView .login-form-wrap h2 {
  color: #07101b;
  font-size: 34px;
  margin-bottom: 10px;
}

#loginView .login-form-wrap p {
  color: #607187;
}

#loginView .login-form-wrap label {
  color: #3d4c60;
}

#loginView .login-form-wrap input {
  color: #07101b;
  background: #ffffff;
  border-color: rgba(76, 95, 118, 0.18);
  box-shadow: inset 0 1px 0 rgba(7, 16, 27, 0.03);
}

#loginView .login-form-wrap input::placeholder {
  color: rgba(67, 82, 101, 0.38);
}

#loginView .login-form-wrap .primary {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  background: #07101b;
  color: #eff7ff;
  box-shadow: 0 18px 38px rgba(7, 16, 27, 0.18);
}

#loginView .login-form-wrap .primary:hover,
#loginView .login-form-wrap .primary:focus-visible {
  background: #14243a;
}

#loginView .login-form-foot {
  margin-top: auto;
  padding-top: 28px;
  color: #68778a;
  line-height: 1.5;
}

#loginView .login-form-foot a {
  color: #07101b;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#loginView .error {
  color: #b42318;
}

@media (max-width: 1080px) {
  .login-layout,
  .login-scale-panel,
  .site-contact-card {
    grid-template-columns: 1fr;
  }

  .site-contact-actions {
    justify-items: start;
  }

  .login-product-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #loginView.login-shell {
    padding: 12px;
  }

  .login-stage {
    min-height: calc(100vh - 24px);
    gap: 12px;
  }

  .login-topbar {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 22px;
  }

  .login-status-pill {
    width: 100%;
    justify-content: center;
  }

  .login-layout {
    gap: 12px;
  }

  .login-hero,
  #loginView .login-form-wrap,
  .login-command-board {
    border-radius: 24px;
  }

  .login-hero {
    padding: 26px;
  }

  .login-hero h1 {
    font-size: clamp(42px, 17vw, 70px);
  }

  .login-right-rail {
    gap: 12px;
  }
}

/* Beta2 app contrast hardening: modal forms must read like operational tools, not disabled fields. */
.modal-shell .modal-card {
  background: rgba(255, 255, 255, 0.98);
  color: var(--ops-ink, #102033);
}

.modal-shell .modal-head {
  background: rgba(255, 255, 255, 0.96);
}

.modal-shell .modal-card label,
.modal-shell .modal-card .form-row label {
  color: #30465d;
  font-weight: 850;
}

.modal-shell .modal-card input,
.modal-shell .modal-card select,
.modal-shell .modal-card textarea {
  color: #102033;
  background: #ffffff;
  border: 1px solid #aebfd0;
  box-shadow: inset 0 1px 0 rgba(16, 32, 51, 0.04);
}

.modal-shell .modal-card input::placeholder,
.modal-shell .modal-card textarea::placeholder {
  color: #73869a;
}

.modal-shell .modal-card input[readonly],
.modal-shell .modal-card textarea[readonly] {
  color: #27394d;
  background: #eef4f8;
  border-color: #bdccd9;
}

.modal-shell .modal-card input:disabled,
.modal-shell .modal-card select:disabled,
.modal-shell .modal-card textarea:disabled {
  color: #566b80;
  background: #e9eff5;
  border-color: #c5d1dd;
  opacity: 1;
}

.modal-shell .modal-card input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--ops-teal, #0b7c73);
  box-shadow: none;
}

.modal-shell .modal-card .import-meta-grid,
.modal-shell .modal-card .form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.modal-shell .modal-card .form-row {
  margin-bottom: 0;
}

#deliveryNoteModal .import-meta-card {
  background: #f7fbff;
  border-color: #b9c9d9;
}

#deliveryNoteModal .import-meta-card .k {
  color: #496178;
  font-weight: 850;
}

#deliveryNoteModal .import-meta-card .v {
  color: #102033;
}

#deliveryNoteModal .compact-table th {
  color: #405b75;
  background: #e9f1f8;
}

#deliveryNoteModal .compact-table td {
  color: #102033;
}

#deliveryNoteModal .compact-table select {
  color: #102033;
  background: #ffffff;
  border-color: #9fb4c8;
}

#deliveryNoteModal .compact-table .delivery-note-qty-input {
  width: 96px;
  min-width: 96px;
  font-weight: 850;
  text-align: right;
  color: #102033;
  background: #ffffff;
  border: 1px solid #8fa9c2;
}

#deliveryNoteModal .compact-table select:disabled,
#deliveryNoteModal .compact-table .delivery-note-qty-input:disabled {
  color: #52677d;
  background: #e9eff5;
}

body[data-theme="dark"] .modal-shell .modal-card {
  background: #101d2b;
  color: #eef5fc;
}

body[data-theme="dark"] .modal-shell .modal-head {
  background: rgba(16, 29, 43, 0.96);
}

body[data-theme="dark"] .modal-shell .modal-card label,
body[data-theme="dark"] .modal-shell .modal-card .form-row label {
  color: #d6e4f2;
}

body[data-theme="dark"] .modal-shell .modal-card input,
body[data-theme="dark"] .modal-shell .modal-card select,
body[data-theme="dark"] .modal-shell .modal-card textarea {
  color: #eef5fc;
  background: #142438;
  border-color: rgba(168, 188, 210, 0.42);
}

body[data-theme="dark"] .modal-shell .modal-card input[readonly],
body[data-theme="dark"] .modal-shell .modal-card textarea[readonly],
body[data-theme="dark"] .modal-shell .modal-card input:disabled,
body[data-theme="dark"] .modal-shell .modal-card select:disabled,
body[data-theme="dark"] .modal-shell .modal-card textarea:disabled {
  color: #aebfd0;
  background: #0f1b2a;
  border-color: rgba(168, 188, 210, 0.26);
  opacity: 1;
}

@media (max-width: 980px) {
  .modal-shell .modal-card .import-meta-grid,
  .modal-shell .modal-card .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .modal-shell .modal-card .import-meta-grid,
  .modal-shell .modal-card .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Final dark-mode contract. Keep this after every light-theme design layer. */
body[data-theme="dark"] {
  background-color: #08111d;
}

body[data-theme="dark"] #appView:not(.hidden),
body[data-theme="dark"] #appView:not(.hidden) .app-grid,
body[data-theme="dark"] #appView:not(.hidden) .workspace-stage {
  color: #e7eef7;
  background-color: #08111d;
}

body[data-theme="dark"] #appView:not(.hidden) .header {
  background: #091524;
  border-bottom-color: rgba(151, 174, 199, 0.22);
}

body[data-theme="dark"] #appView:not(.hidden) .main-tabs {
  background: #0d1a2a;
  border-bottom-color: rgba(151, 174, 199, 0.22);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"] #appView:not(.hidden) .nav-item {
  color: #b7c6d8;
  background: #152438;
  border-color: rgba(151, 174, 199, 0.22);
  box-shadow: none;
}

body[data-theme="dark"] #appView:not(.hidden) .nav-prefix {
  color: #c7ddf2;
  background: rgba(199, 221, 242, 0.12);
}

body[data-theme="dark"] #appView:not(.hidden) .nav-item:hover {
  color: #f8fbff;
  background: #1a2c43;
  border-color: rgba(111, 174, 235, 0.54);
}

body[data-theme="dark"] #appView:not(.hidden) .nav-item.active {
  color: #ffffff;
  background: #2669ad;
  border-color: #3b82c4;
  box-shadow: 0 12px 24px rgba(17, 86, 151, 0.30);
}

body[data-theme="dark"] #appView:not(.hidden) .nav-item.active .nav-prefix {
  color: #205f9d;
  background: #edf6ff;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-stage .view-header,
body[data-theme="dark"] #appView:not(.hidden) .workspace-stage .toolbar,
body[data-theme="dark"] #appView:not(.hidden) .workspace-stage .content-shell,
body[data-theme="dark"] #appView:not(.hidden) .panel,
body[data-theme="dark"] #appView:not(.hidden) .table-wrap,
body[data-theme="dark"] #appView:not(.hidden) .orders-pager,
body[data-theme="dark"] #appView:not(.hidden) .status-card,
body[data-theme="dark"] #appView:not(.hidden) .activity-item,
body[data-theme="dark"] #appView:not(.hidden) .kv-item,
body[data-theme="dark"] #appView:not(.hidden) .import-meta-card,
body[data-theme="dark"] #appView:not(.hidden) .metric {
  color: #e7eef7;
  background: #0f1b2a;
  border-color: rgba(151, 174, 199, 0.22);
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-stage .content-shell {
  background: transparent;
}

body[data-theme="dark"] #appView:not(.hidden) .workspace-stage .factory-tabs {
  background: #0f1b2a;
  border-color: rgba(151, 174, 199, 0.18);
}

body[data-theme="dark"] #appView:not(.hidden) .view-header h2,
body[data-theme="dark"] #appView:not(.hidden) .panel h3,
body[data-theme="dark"] #appView:not(.hidden) .metric .value,
body[data-theme="dark"] #appView:not(.hidden) .cell-title,
body[data-theme="dark"] #appView:not(.hidden) .list-title,
body[data-theme="dark"] #appView:not(.hidden) .stock-primary {
  color: #f3f7fc;
}

body[data-theme="dark"] #appView:not(.hidden) .view-header p,
body[data-theme="dark"] #appView:not(.hidden) .cell-sub,
body[data-theme="dark"] #appView:not(.hidden) .list-meta,
body[data-theme="dark"] #appView:not(.hidden) .toolbar-meta,
body[data-theme="dark"] #appView:not(.hidden) .stock-breakdown,
body[data-theme="dark"] #appView:not(.hidden) .stock-hint,
body[data-theme="dark"] #appView:not(.hidden) .muted {
  color: #9fb1c5;
}

body[data-theme="dark"] #appView:not(.hidden) input,
body[data-theme="dark"] #appView:not(.hidden) select,
body[data-theme="dark"] #appView:not(.hidden) textarea,
body[data-theme="dark"] #appView:not(.hidden) .search-box,
body[data-theme="dark"] #appView:not(.hidden) .search-clear,
body[data-theme="dark"] #appView:not(.hidden) .segmented,
body[data-theme="dark"] #appView:not(.hidden) .orders-pager-select {
  color: #e7eef7;
  background: #142438;
  border-color: rgba(151, 174, 199, 0.32);
  box-shadow: none;
}

body[data-theme="dark"] #appView:not(.hidden) input::placeholder,
body[data-theme="dark"] #appView:not(.hidden) textarea::placeholder {
  color: #7f93aa;
}

body[data-theme="dark"] #appView:not(.hidden) input:disabled,
body[data-theme="dark"] #appView:not(.hidden) select:disabled,
body[data-theme="dark"] #appView:not(.hidden) textarea:disabled {
  color: #8497ad;
  background: #101d2c;
  border-color: rgba(151, 174, 199, 0.18);
  opacity: 1;
}

body[data-theme="dark"] #appView:not(.hidden) .secondary,
body[data-theme="dark"] #appView:not(.hidden) .toolbar-actions .secondary,
body[data-theme="dark"] #appView:not(.hidden) .table-action {
  color: #dbe6f2;
  background: #17273a;
  border-color: rgba(151, 174, 199, 0.32);
}

body[data-theme="dark"] #appView:not(.hidden) .secondary:hover,
body[data-theme="dark"] #appView:not(.hidden) .toolbar-actions .secondary:hover,
body[data-theme="dark"] #appView:not(.hidden) .table-action:hover {
  color: #ffffff;
  background: #20344c;
  border-color: #4f8fc8;
}

body[data-theme="dark"] #appView:not(.hidden) button:disabled,
body[data-theme="dark"] #appView:not(.hidden) .table-action:disabled {
  color: #718398;
  background: #111e2d;
  border-color: rgba(151, 174, 199, 0.14);
  opacity: 0.72;
}

body[data-theme="dark"] #appView:not(.hidden) .segmented button {
  color: #9fb1c5;
}

body[data-theme="dark"] #appView:not(.hidden) .segmented button.is-active {
  color: #f8fbff;
  background: #31445a;
  box-shadow: none;
}

body[data-theme="dark"] #appView:not(.hidden) .factory-tab {
  color: #b5c5d7;
  background: #17273a;
  border-color: rgba(151, 174, 199, 0.28);
  backdrop-filter: none;
}

body[data-theme="dark"] #appView:not(.hidden) .factory-tab:hover {
  color: #ffffff;
  background: #20344c;
  border-color: #cf8a2c;
}

body[data-theme="dark"] #appView:not(.hidden) .factory-tab.active {
  color: #ffffff;
  background: #b86e14;
  border-color: #d18a2c;
  box-shadow: 0 10px 20px rgba(184, 110, 20, 0.22);
}

body[data-theme="dark"] #appView:not(.hidden) .data-table {
  color: #e7eef7;
  background: #0f1d2c;
}

body[data-theme="dark"] #appView:not(.hidden) .data-table th {
  color: #b8c8da;
  background: #17283b;
  border-bottom-color: rgba(151, 174, 199, 0.30);
}

body[data-theme="dark"] #appView:not(.hidden) .data-table td {
  color: #dfe9f4;
  background: #0f1d2c;
  border-bottom-color: rgba(151, 174, 199, 0.20);
}

body[data-theme="dark"] #appView:not(.hidden) .data-table tbody tr:nth-child(even),
body[data-theme="dark"] #appView:not(.hidden) .data-table tbody tr:nth-child(even) td {
  background: #132337;
}

body[data-theme="dark"] #appView:not(.hidden) .data-table tbody tr:hover td,
body[data-theme="dark"] #appView:not(.hidden) .order-row-clickable:hover td {
  background: #17384a;
}

body[data-theme="dark"] #appView:not(.hidden) .table-link {
  color: #70b7f4;
}

body[data-theme="dark"] #appView:not(.hidden) .table-link:hover {
  color: #a8d5fb;
}

body[data-theme="dark"] #appView:not(.hidden) .notice {
  color: #dce7f2;
  background: #142438;
  border-color: rgba(151, 174, 199, 0.28);
}

@media (max-width: 760px) {
  body[data-theme="dark"] #appView:not(.hidden) #view-orders .data-table td,
  body[data-theme="dark"] #appView:not(.hidden) #view-shipments .data-table td,
  body[data-theme="dark"] #appView:not(.hidden) #view-orders .data-table td[data-card-role="wide"],
  body[data-theme="dark"] #appView:not(.hidden) #view-shipments .data-table td[data-card-role="wide"] {
    color: #dfe9f4;
    background: #0f1d2c;
  }

  body[data-theme="dark"] #appView:not(.hidden) #view-orders .data-table tr:nth-child(even) td,
  body[data-theme="dark"] #appView:not(.hidden) #view-shipments .data-table tr:nth-child(even) td {
    background: #132337;
  }
}
