* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--warm-page-bg);
  color: var(--warm-text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell,
body.auth-locked .mobile-sidebar-toggle,
body.auth-locked .sidebar-scrim {
  visibility: hidden;
}

.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 252, 248, 0.98), rgba(255, 247, 236, 0.96) 42%, rgba(248, 238, 224, 0.92) 100%),
    linear-gradient(135deg, rgba(201, 138, 58, 0.09), rgba(255, 255, 255, 0));
}

.startup-screen[hidden] {
  display: none;
}

.startup-card {
  width: min(460px, 100%);
  border: 1px solid rgba(238, 223, 204, 0.92);
  border-radius: 26px;
  background: rgba(255, 253, 252, 0.94);
  box-shadow: 0 26px 80px rgba(120, 80, 40, 0.12);
  padding: 28px 28px 24px;
  backdrop-filter: blur(10px);
}

.startup-logo {
  width: 168px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.startup-copy {
  margin-top: 18px;
}

.startup-kicker {
  margin: 0 0 10px;
  color: var(--warm-kicker);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.startup-copy h1 {
  margin: 0;
  color: var(--warm-text);
  font-size: 28px;
  line-height: 1.1;
}

.startup-copy p:last-child {
  margin: 10px 0 0;
  color: var(--warm-muted-strong);
  font-size: 14px;
  line-height: 1.6;
}

.startup-progress {
  height: 8px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(201, 138, 58, 0.12);
}

.startup-progress span {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d6a15d 0%, #c98a3a 52%, #8a6844 100%);
  animation: startup-slide 1.35s ease-in-out infinite;
  box-shadow: 0 0 18px rgba(201, 138, 58, 0.22);
}

@keyframes startup-slide {
  0% {
    transform: translateX(-115%);
  }

  50% {
    transform: translateX(120%);
  }

  100% {
    transform: translateX(260%);
  }
}

.desktop-banner {
  position: fixed;
  left: 50%;
  top: 16px;
  z-index: 45;
  transform: translateX(-50%);
  min-width: 320px;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--warm-border);
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 18px 40px rgba(120, 80, 40, 0.14);
  color: var(--warm-text);
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.desktop-banner[data-tone="danger"] {
  color: #a3483a;
  background: rgba(255, 242, 239, 0.98);
  border-color: #efc7c0;
}

.desktop-banner[data-tone="success"] {
  color: var(--warm-green-label);
  background: rgba(237, 246, 230, 0.98);
  border-color: rgba(122, 155, 89, 0.18);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.seller-profile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0;
}

.seller-profile-summary div {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--warm-border);
}

.seller-profile-summary dt {
  color: var(--warm-muted);
  font-size: 12px;
  font-weight: 700;
}

.seller-profile-summary dd {
  margin: 5px 0 0;
  color: var(--warm-text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .seller-profile-summary {
    grid-template-columns: 1fr;
  }
}

.staff-mention-menu {
  position: fixed;
  z-index: 70;
  overflow: hidden;
  border: 1px solid var(--warm-border);
  border-radius: 14px;
  background: var(--warm-surface);
  box-shadow: var(--warm-shadow);
  padding: 6px;
}

.staff-mention-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--warm-text);
  padding: 7px 9px;
  text-align: left;
  font-weight: 800;
}

.staff-mention-option:hover,
.staff-mention-option:focus-visible {
  background: rgba(243, 223, 194, 0.56);
  outline: none;
}

.staff-mention-option small {
  color: var(--warm-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  height: 100vh;
  opacity: 1;
  transform: none;
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

body.startup-active .app-shell {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  min-height: 100dvh;
  background: #fff8ef;
}

.auth-gate[hidden] {
  display: none;
}

.auth-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(380px, 0.92fr) minmax(560px, 1.08fr);
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 22%, rgba(255, 255, 255, 0.82), transparent 27%),
    radial-gradient(circle at 82% 16%, rgba(239, 220, 197, 0.26), transparent 25%),
    #fff8ef;
}

.auth-scene {
  position: relative;
  isolation: isolate;
  overflow: visible;
  min-height: 640px;
  background: transparent;
}

.auth-scene::after {
  display: none;
}

.auth-brand-panel {
  position: absolute;
  z-index: 3;
  left: clamp(54px, 8vw, 126px);
  top: 43%;
  width: min(440px, calc(100% - 96px));
  transform: translateY(-50%);
}

.auth-brand-overline {
  margin: 0 0 20px;
  color: #9a7b58;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.auth-brand-panel h2 {
  margin: 0;
  color: #3d3025;
  font-size: clamp(30px, 3.3vw, 44px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.34;
  text-wrap: balance;
}

.auth-brand-summary {
  margin: 22px 0 0;
  color: #756657;
  font-size: 15px;
  line-height: 1.7;
}

.auth-visual-curve {
  position: absolute;
  border: 1px solid rgba(195, 158, 117, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.auth-visual-curve.curve-one {
  left: -28%;
  top: -20%;
  width: 94%;
  aspect-ratio: 1;
  box-shadow: inset 0 0 0 42px rgba(247, 228, 204, 0.16);
}

.auth-visual-curve.curve-two {
  right: -34%;
  bottom: -36%;
  width: 82%;
  aspect-ratio: 1;
  border-width: 34px;
  border-color: rgba(233, 208, 176, 0.15);
}

.auth-category-marks {
  position: absolute;
  z-index: 3;
  left: clamp(54px, 8vw, 126px);
  bottom: 12%;
  display: grid;
  grid-template-columns: repeat(4, 76px);
  gap: 14px;
}

.auth-category-mark {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  width: 76px;
  height: 72px;
  border: 1px solid rgba(202, 176, 145, 0.24);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 30px rgba(120, 80, 40, 0.035);
  color: rgba(111, 89, 67, 0.52);
}

.auth-category-mark svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.35;
}

.auth-category-mark small {
  color: rgba(111, 89, 67, 0.62);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.auth-scene-arch {
  position: absolute;
  left: -12%;
  top: 17%;
  width: 58%;
  height: 52%;
  border: 18px solid rgba(252, 250, 246, 0.88);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(155deg, rgba(205, 183, 157, 0.52), rgba(232, 218, 201, 0.34));
  box-shadow: inset -12px 10px 36px rgba(91, 69, 47, 0.055);
}

.auth-scene-rug {
  position: absolute;
  z-index: 2;
  left: 13%;
  bottom: 6%;
  width: 72%;
  height: 16%;
  border-radius: 50%;
  background: rgba(253, 251, 247, 0.94);
  box-shadow: 0 14px 34px rgba(91, 69, 47, 0.07), inset 0 0 0 4px rgba(217, 204, 188, 0.28);
}

.auth-scene-star {
  position: absolute;
  z-index: 3;
  color: #b99466;
  opacity: 0.28;
  font-size: 22px;
}

.auth-scene-star.star-one { left: 19%; top: 12%; }
.auth-scene-star.star-two { display: none; }

.auth-scene-cloud {
  position: absolute;
  z-index: 1;
  width: 86px;
  height: 28px;
  border-radius: 999px;
  background: rgba(250, 247, 242, 0.58);
  opacity: 0.44;
}

.auth-scene-cloud::before,
.auth-scene-cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
}

.auth-scene-cloud::before { left: 15px; width: 38px; height: 38px; }
.auth-scene-cloud::after { right: 13px; width: 46px; height: 46px; }
.auth-scene-cloud.cloud-one { right: 11%; top: 37%; }
.auth-scene-cloud.cloud-two { left: 38%; top: 9%; transform: scale(0.65); opacity: 0.72; }

.auth-scene-bear {
  position: absolute;
  z-index: 5;
  left: 14%;
  bottom: 13%;
  width: 210px;
  height: 285px;
  filter: drop-shadow(0 14px 16px rgba(91, 69, 47, 0.08));
  transform: scale(0.82);
  transform-origin: bottom left;
}

.bear-ear,
.bear-head,
.bear-body,
.bear-foot {
  position: absolute;
  display: block;
  background: #c8aa83;
}

.bear-ear { top: 13px; width: 67px; height: 67px; border-radius: 50%; }
.bear-ear::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #dfc8aa; }
.bear-ear.ear-left { left: 14px; }
.bear-ear.ear-right { right: 14px; }
.bear-head { z-index: 2; left: 34px; top: 28px; width: 142px; height: 132px; border-radius: 48% 48% 44% 44%; }
.bear-body { left: 42px; top: 137px; width: 126px; height: 125px; border-radius: 48% 48% 38% 38%; background: #c2a179; }
.bear-eye { position: absolute; z-index: 3; top: 48px; width: 7px; height: 8px; border-radius: 50%; background: #594b3e; opacity: 0.8; }
.bear-eye.eye-left { left: 41px; }
.bear-eye.eye-right { right: 41px; }
.bear-muzzle { position: absolute; z-index: 3; left: 45px; bottom: 22px; width: 52px; height: 43px; border-radius: 48%; background: #e5d1b7; }
.bear-muzzle::before { content: ""; position: absolute; left: 19px; top: 8px; width: 14px; height: 10px; border-radius: 48% 48% 60% 60%; background: #625043; }
.bear-foot { z-index: 3; bottom: 1px; width: 72px; height: 58px; border-radius: 50%; background: #cdb08c; }
.bear-foot.foot-left { left: 17px; transform: rotate(-10deg); }
.bear-foot.foot-right { right: 17px; transform: rotate(10deg); }

.auth-scene-stack {
  position: absolute;
  z-index: 5;
  left: 42%;
  bottom: 12%;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  filter: drop-shadow(0 14px 14px rgba(120, 80, 40, 0.1));
  transform: scale(0.82);
  transform-origin: bottom;
}

.auth-scene-stack span { display: block; height: 34px; border-radius: 999px; border: 1px solid rgba(111, 78, 46, 0.08); }
.auth-scene-stack span:nth-child(1) { width: 105px; background: #bd9460; }
.auth-scene-stack span:nth-child(2) { width: 88px; background: #aab194; }
.auth-scene-stack span:nth-child(3) { width: 70px; background: #c7a080; }
.auth-scene-stack span:nth-child(4) { width: 50px; background: #ddd4c5; }

.auth-scene-rainbow {
  position: absolute;
  z-index: 5;
  right: 12%;
  bottom: 12%;
  width: 162px;
  height: 104px;
  overflow: hidden;
  opacity: 0.86;
  transform: scale(0.76);
  transform-origin: bottom right;
}

.auth-scene-rainbow span { position: absolute; left: 50%; bottom: -48px; border-style: solid; border-radius: 50% 50% 0 0; transform: translateX(-50%); }
.auth-scene-rainbow span:nth-child(1) { width: 162px; height: 162px; border-width: 24px; border-color: #bd8c67; }
.auth-scene-rainbow span:nth-child(2) { width: 115px; height: 115px; border-width: 22px; border-color: #c8aa72; }
.auth-scene-rainbow span:nth-child(3) { width: 72px; height: 72px; border-width: 20px; border-color: #929d82; }

.auth-scene-plant {
  position: absolute;
  z-index: 4;
  right: 15%;
  top: 26%;
  width: 120px;
  height: 230px;
  transform: scale(0.86);
  transform-origin: bottom;
}

.plant-pot { position: absolute; left: 27px; bottom: 0; width: 72px; height: 85px; border-radius: 12px 12px 28px 28px; background: #ddd0bd; box-shadow: inset -8px -8px 18px rgba(91, 69, 47, 0.055); }
.plant-stem { position: absolute; left: 59px; bottom: 70px; width: 3px; height: 136px; border-radius: 4px; background: #737d61; transform: rotate(2deg); }
.plant-leaf { position: absolute; width: 44px; height: 21px; border-radius: 100% 0 100% 0; background: #7d876c; }
.plant-leaf.leaf-one { left: 15px; top: 45px; transform: rotate(24deg); }
.plant-leaf.leaf-two { right: 7px; top: 74px; transform: scaleX(-1) rotate(18deg); }
.plant-leaf.leaf-three { left: 17px; top: 108px; transform: rotate(16deg); background: #9ba67b; }

.auth-form-pane {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 48px clamp(36px, 6vw, 104px);
  background: transparent;
}

.auth-form-pane::before {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -16%;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 34px solid rgba(220, 207, 190, 0.22);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  max-height: calc(100dvh - 72px);
  overflow: auto;
  border: 1px solid #eadac6;
  border-radius: 28px;
  background: #fffdfc;
  box-shadow: 0 24px 60px rgba(120, 80, 40, 0.08);
  padding: 48px 56px 30px;
}

.app-version {
  margin: 14px 0 0;
  color: var(--warm-muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-submit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.mfa-login-step {
  display: grid;
  gap: 14px;
}

.mfa-step-heading {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--warm-border-soft);
  border-radius: 14px;
  background: var(--warm-surface-soft);
}

.mfa-step-heading strong {
  color: var(--warm-text);
  font-size: 15px;
}

.mfa-step-heading span,
.mfa-secret-row span {
  color: var(--warm-muted-strong);
  font-size: 12px;
  line-height: 1.55;
}

.mfa-qr-image {
  width: 196px;
  height: 196px;
  margin: 0 auto;
  border: 1px solid var(--warm-border);
  border-radius: 14px;
  background: var(--warm-surface);
  padding: 8px;
}

.mfa-open-app {
  justify-self: center;
  width: fit-content;
  text-decoration: none;
}

.mfa-secret-row {
  display: grid;
  gap: 6px;
}

.mfa-secret-row code {
  overflow-wrap: anywhere;
  border: 1px dashed var(--warm-border-strong);
  border-radius: 10px;
  background: var(--warm-surface);
  color: var(--warm-text-soft);
  padding: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
}

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

.mfa-recovery-grid code {
  border: 1px solid var(--warm-border);
  border-radius: 10px;
  background: var(--warm-surface);
  color: var(--warm-text-soft);
  padding: 8px;
  text-align: center;
  font-size: 11px;
}

.mfa-confirm-save {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.mfa-confirm-save input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.text-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--warm-action);
  padding: 0;
  font-size: 13px;
  font-weight: 800;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--warm-action-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-brand {
  display: block;
  margin: 0 0 34px;
  padding: 0;
  text-align: center;
}

.auth-brand h1 {
  margin: 0;
  color: #2b2118;
  font-size: clamp(33px, 3vw, 38px);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

.auth-brand p {
  margin: 14px 0 0;
  color: #70665b;
  font-size: 15px;
  line-height: 1.6;
}

.auth-card label {
  color: #4f4032;
}

#login-password-step {
  display: grid;
  gap: 20px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field-label {
  font-size: 14px;
  font-weight: 750;
}

.auth-input-wrap {
  position: relative;
  display: block;
}

.auth-input-wrap::before {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.auth-input-user::before {
  left: 25px;
  top: calc(50% - 9px);
  width: 8px;
  height: 8px;
  border: 1.8px solid #7a6a58;
  border-radius: 50%;
}

.auth-input-user::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 20px;
  top: calc(50% + 1px);
  width: 18px;
  height: 10px;
  border: 1.8px solid #7a6a58;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}

.auth-input-lock::before {
  left: 19px;
  top: 50%;
  width: 17px;
  height: 14px;
  border: 1.8px solid #7a6a58;
  border-radius: 3px;
  transform: translateY(-50%);
}

.auth-input-lock::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 23px;
  top: calc(50% - 13px);
  width: 9px;
  height: 9px;
  border: 1.8px solid #7a6a58;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  pointer-events: none;
}

.auth-card input {
  width: 100%;
  min-height: 56px;
  border: 1px solid #dcc9b2;
  border-radius: 13px;
  background: #fffdfc;
  color: #2b2118;
  padding: 0 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  outline: none;
}

.auth-input-wrap input {
  padding-left: 52px;
}

.auth-input-lock input {
  padding-right: 72px;
}

.auth-card input::placeholder {
  color: #9b8a78;
  opacity: 1;
}

.auth-card input:focus {
  border-color: #c98a3a;
  box-shadow: 0 0 0 3px rgba(201, 138, 58, 0.12);
}

.auth-password-toggle {
  position: absolute;
  z-index: 3;
  right: 8px;
  top: 50%;
  min-width: 44px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8b7967;
  font-size: 0;
  font-weight: 750;
  transform: translateY(-50%);
}

.auth-password-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
}

.auth-password-toggle .auth-eye-slash {
  opacity: 0;
  transition: opacity 160ms ease;
}

.auth-password-toggle[aria-pressed="true"] .auth-eye-slash {
  opacity: 1;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  background: #f7e8d2;
  color: #4f3520;
  outline: none;
}

.auth-helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 2px;
  color: #6b5a48;
  font-size: 14px;
}

.auth-remember {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  cursor: default;
}

.auth-remember input {
  width: 19px;
  min-height: 19px;
  height: 19px;
  margin: 0;
  border-color: #c98a3a;
  accent-color: #b96f26;
  opacity: 1;
  filter: sepia(0.32) saturate(1.7);
}

.auth-safe-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.auth-safe-note i {
  display: grid;
  place-items: center;
  width: 19px;
  height: 22px;
  border: 1.5px solid #c98a3a;
  border-radius: 9px 9px 11px 11px;
  color: #b87327;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.auth-safe-note[data-secure="false"] {
  color: #9a5b3f;
}

.auth-safe-note[data-secure="false"] i {
  border-color: #bf7a5c;
  color: #9a5b3f;
}

body.auth-locked .auth-card .primary-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #d59a4a 0%, #bf7a2f 100%);
  box-shadow: 0 14px 24px rgba(169, 103, 37, 0.19);
  color: #fff;
  font-size: 22px;
  font-weight: 750;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease, filter 180ms ease;
}

body.auth-locked .auth-card .primary-button:hover {
  background: linear-gradient(180deg, #ce9140 0%, #b66f28 100%);
  box-shadow: 0 17px 28px rgba(169, 103, 37, 0.23);
  transform: translateY(-1px);
}

body.auth-locked .auth-card .primary-button:active {
  transform: translateY(0);
}

body.auth-locked .auth-card .primary-button:disabled {
  cursor: wait;
  filter: saturate(0.55);
  opacity: 0.68;
  transform: none;
}

.auth-card .secondary-button {
  min-height: 48px;
  border-color: #dcc9b2;
  border-radius: 12px;
  background: #fffaf4;
  color: #6b4b2c;
}

.auth-card .app-version {
  margin: 28px 0 0;
  color: #8a7968;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card {
  animation: auth-card-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (max-width: 1180px) {
  .auth-layout {
    grid-template-columns: minmax(320px, 0.78fr) minmax(500px, 1.22fr);
  }

  .auth-form-pane {
    padding-inline: 42px;
  }

  .auth-brand-panel {
    left: 40px;
    width: calc(100% - 64px);
  }

  .auth-brand-panel h2 {
    font-size: 31px;
  }

  .auth-category-marks {
    left: 40px;
    bottom: 8%;
    grid-template-columns: repeat(2, 72px);
    gap: 10px;
  }

  .auth-category-mark {
    width: 72px;
    height: 64px;
    border-radius: 16px;
  }

  .auth-scene-bear {
    left: 4%;
    transform: scale(0.84);
    transform-origin: bottom left;
  }

  .auth-scene-stack { left: 40%; transform: scale(0.86); transform-origin: bottom; }
  .auth-scene-rainbow { right: 2%; transform: scale(0.78); transform-origin: bottom right; }
  .auth-scene-plant { right: 7%; transform: scale(0.85); transform-origin: bottom; }
}

@media (max-width: 820px) {
  .auth-layout {
    display: block;
    min-height: 100dvh;
  }

  .auth-scene {
    display: none;
  }

  .auth-form-pane {
    min-height: 100dvh;
    padding: 24px 16px;
  }

  .auth-card {
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    border-radius: 24px;
    padding: 38px 28px 28px;
  }

  .auth-brand {
    margin-bottom: 30px;
  }

  .auth-brand h1 {
    font-size: 32px;
  }
}

@media (max-width: 440px) {
  .auth-form-pane {
    align-items: center;
    padding: 16px;
  }

  .auth-card {
    width: calc(100vw - 32px);
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
    padding: 32px 22px 24px;
  }

  .auth-brand h1 { font-size: 29px; }
  .auth-brand p { font-size: 14px; }
  .auth-helper-row { gap: 12px; font-size: 13px; }
  .auth-safe-note i { width: 18px; height: 20px; }
  body.auth-locked .auth-card .primary-button { min-height: 56px; font-size: 20px; }
  .mfa-recovery-grid { grid-template-columns: 1fr; }
}

@media (max-height: 720px) and (min-width: 821px) {
  .auth-form-pane { padding-block: 24px; }
  .auth-card { max-height: calc(100dvh - 32px); padding-block: 34px 24px; }
  .auth-brand { margin-bottom: 24px; }
  .auth-brand h1 { font-size: 34px; }
  #login-password-step { gap: 14px; }
  .auth-card input { min-height: 52px; }
  body.auth-locked .auth-card .primary-button { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }

  body.auth-locked .auth-card .primary-button {
    transition: none;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  overflow: hidden;
  padding: 14px 14px 16px;
  background: linear-gradient(180deg, var(--warm-sidebar-bg-start) 0%, var(--warm-sidebar-bg-end) 100%);
  color: var(--warm-text-soft);
  border-right: 1px solid var(--warm-border);
}

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

.sidebar .brand {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 68px;
}

.brand-logo {
  width: 126px;
  height: 44px;
  object-fit: contain;
  object-position: left center;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
}

.brand p,
.summary-panel small {
  margin: 2px 0 0;
  color: var(--warm-kicker);
  font-size: 12px;
}

.sidebar .brand > div {
  min-width: 0;
  flex: 1;
}

.sidebar .brand h1 {
  font-size: 17px;
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-account-inline {
  margin: 4px 0 0;
  color: var(--warm-muted);
  font-size: 11px;
  line-height: 1.3;
}

.sidebar-account-inline span {
  color: var(--warm-text-soft);
  font-weight: 700;
}

.sidebar-account-status {
  margin: 3px 0 0;
  color: var(--warm-muted-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.sidebar-account-status span {
  color: var(--warm-text-soft);
}

.sidebar-brand-mark {
  display: grid;
  place-items: center;
  width: 204px;
  height: 66px;
  flex: 0 0 auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: none;
}

.nav-tabs {
  display: grid;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 163, 181, 0.36) transparent;
}

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

.nav-group-title {
  color: var(--warm-kicker);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 0 3px;
}

.nav-tab {
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--warm-text-soft);
  text-align: left;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.nav-child {
  margin-left: 0;
  width: 100%;
  padding-left: 12px;
}

.nav-tabs::-webkit-scrollbar {
  width: 6px;
}

.nav-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.nav-tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(174, 147, 119, 0.28);
}

.nav-tabs::-webkit-scrollbar-thumb:hover {
  background: rgba(174, 147, 119, 0.42);
}

.nav-tab.active,
.nav-tab:hover {
  background: var(--warm-highlight);
  border-color: var(--warm-highlight-line);
  color: var(--warm-action-strong);
}

.summary-panel {
  padding: 12px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface-soft);
  box-shadow: var(--warm-shadow-soft);
}

.sidebar-panel-label {
  display: block;
  color: var(--warm-kicker);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-status-card strong {
  display: block;
  color: var(--warm-text-soft);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
}

.summary-panel {
  margin-top: auto;
  flex-shrink: 0;
  display: grid;
  gap: 10px;
}

.system-panel {
  overflow: visible;
}

.system-panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: default;
  list-style: none;
  user-select: none;
}

.system-panel-summary::-webkit-details-marker {
  display: none;
}

.system-panel-caret {
  display: none;
}

.system-panel[open] .system-panel-caret {
  transform: none;
}

.system-panel-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.sidebar-status-card {
  display: grid;
  gap: 4px;
}

.sidebar-refresh-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--warm-border);
  background: var(--warm-sidebar-bg-start);
  color: var(--warm-action);
  font-size: 18px;
  line-height: 1;
}

.sidebar-status-card strong[data-tone="success"] {
  color: var(--warm-green-label);
}

.sidebar-status-card strong[data-tone="danger"] {
  color: #b14f42;
}

.sidebar-status-card strong[data-tone="warning"] {
  color: var(--warm-orange-label);
}

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

.sidebar-button {
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-button-logout {
  width: 100%;
  min-height: 34px;
}

.summary-panel .app-version {
  color: var(--warm-kicker);
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid var(--warm-border);
  font-size: 11px;
}

body.home-shell-mode,
body.warm-shell-mode {
  background: var(--warm-page-bg);
}

body.home-shell-mode .workspace,
body.warm-shell-mode .workspace {
  background: var(--warm-content-bg);
}

body.home-shell-mode .sidebar,
body.warm-shell-mode .sidebar {
  background: linear-gradient(180deg, var(--warm-sidebar-bg-start) 0%, var(--warm-sidebar-bg-end) 100%);
  color: var(--warm-text-soft);
  border-right: 1px solid var(--warm-border);
}

body.home-shell-mode .sidebar .brand,
body.warm-shell-mode .sidebar .brand {
  min-height: 64px;
}

body.home-shell-mode .sidebar-brand-logo,
body.warm-shell-mode .sidebar-brand-logo {
  filter: sepia(0.45) saturate(0.9) brightness(0.36);
}

body.home-shell-mode .nav-group-title,
body.home-shell-mode .sidebar-panel-label,
body.home-shell-mode .summary-panel .app-version,
body.warm-shell-mode .nav-group-title,
body.warm-shell-mode .sidebar-panel-label,
body.warm-shell-mode .summary-panel .app-version {
  color: var(--warm-kicker);
}

body.home-shell-mode .nav-tabs,
body.warm-shell-mode .nav-tabs {
  gap: 10px;
}

body.home-shell-mode .nav-group,
body.warm-shell-mode .nav-group {
  gap: 4px;
}

body.home-shell-mode .nav-tab,
body.warm-shell-mode .nav-tab {
  min-height: 34px;
  color: var(--warm-text-soft);
  border-radius: 12px;
  padding: 0 12px;
}

body.home-shell-mode .nav-tab.active,
body.home-shell-mode .nav-tab:hover,
body.warm-shell-mode .nav-tab.active,
body.warm-shell-mode .nav-tab:hover {
  background: var(--warm-highlight);
  border-color: var(--warm-highlight-line);
  color: var(--warm-action-strong);
}

body.home-shell-mode .sidebar-account-status,
body.home-shell-mode .sidebar-status-card strong,
body.warm-shell-mode .sidebar-account-status,
body.warm-shell-mode .sidebar-status-card strong {
  color: var(--warm-muted-strong);
}

body.home-shell-mode .sidebar-account-status span,
body.warm-shell-mode .sidebar-account-status span {
  color: var(--warm-text-soft);
}

body.home-shell-mode .summary-panel,
body.warm-shell-mode .summary-panel {
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface-soft);
  box-shadow: var(--warm-shadow-soft);
}

body.home-shell-mode .sidebar-refresh-button,
body.warm-shell-mode .sidebar-refresh-button {
  border-radius: 12px;
  background: var(--warm-sidebar-bg-start);
  color: var(--warm-action);
  border: 1px solid var(--warm-border);
}

.workspace {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#products-view.view.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  min-height: 0;
  overflow: hidden;
}

#products-view .workspace-header {
  flex: 0 0 auto;
}

#products-view .subview-panel.active {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

#products-view .subview-panel.active .table-toolbar {
  flex: 0 0 auto;
}

#products-view .subview-panel.active .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#factory-detail-view.view.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  min-height: 0;
  overflow: hidden;
}

#factory-detail-view .workspace-header,
#factory-detail-view .table-toolbar,
#factory-detail-view .export-panel {
  flex: 0 0 auto;
}

#factory-detail-view > .product-list-panel {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

#factory-detail-view .factory-product-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.factory-product-data-table {
  min-width: 980px;
}

.factory-product-sku-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.factory-product-duplicate-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.factory-product-duplicate-badge.data {
  border-color: #efc7c0;
  background: #fff2ef;
  color: #a9473b;
}

.factory-product-duplicate-badge.sku {
  border-color: #edd8a3;
  background: #fff7dd;
  color: #8d611a;
}

#product-list-manage-header[hidden] {
  display: none !important;
}

#back-from-quote[hidden],
#back-from-invoice[hidden],
#back-to-quote[hidden] {
  display: none !important;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.workspace-header h2 {
  margin: 2px 0 0;
  font-size: 30px;
}

.home-shell {
  display: grid;
  gap: 18px;
}

.home-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  align-items: end;
  gap: 18px;
}

.home-title-block {
  display: grid;
  gap: 14px;
  padding-top: 6px;
}

.home-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-title-row h1 {
  margin: 0;
  color: var(--warm-text);
  font-size: 42px;
  line-height: 1;
}

.home-title-icon {
  position: relative;
  width: 44px;
  height: 28px;
}

.home-title-sun {
  position: absolute;
  right: 5px;
  top: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--warm-sun);
  box-shadow:
    0 -8px 0 -6px var(--warm-sun),
    0 8px 0 -6px var(--warm-sun),
    -8px 0 0 -6px var(--warm-sun),
    8px 0 0 -6px var(--warm-sun);
}

.home-title-cloud {
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 28px;
  height: 14px;
  border-radius: 999px;
  background: var(--warm-cloud);
  box-shadow:
    8px -6px 0 0 var(--warm-cloud),
    18px -3px 0 -1px var(--warm-cloud);
  border: 1px solid var(--warm-cloud-line);
}

.home-topbar-subtitle {
  max-width: 66ch;
  margin: 0;
  color: var(--warm-muted-strong);
  font-size: 15px;
  line-height: 1.7;
}

.home-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-scene {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  border: 1px solid var(--warm-border);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--warm-scene-bg-start) 0%, var(--warm-scene-bg-end) 100%);
  box-shadow: var(--warm-shadow);
}

.home-scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18px;
  background: linear-gradient(180deg, rgba(240, 226, 208, 0), var(--warm-scene-ground));
}

.home-scene-plant,
.home-scene-clothes,
.home-scene-bear,
.home-scene-rainbow,
.home-scene-car,
.home-scene-leaf {
  position: absolute;
  bottom: 18px;
}

.home-scene-plant {
  left: 22px;
  width: 38px;
  height: 48px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, var(--warm-scene-basket-start) 0%, var(--warm-scene-basket-end) 100%);
}

.home-scene-plant::before,
.home-scene-plant::after,
.home-scene-leaf::before,
.home-scene-leaf::after {
  content: "";
  position: absolute;
  bottom: 40px;
  width: 18px;
  height: 26px;
  border-radius: 18px 18px 2px 18px;
  background: var(--warm-scene-leaf-green);
}

.home-scene-plant::before {
  left: 5px;
  transform: rotate(-20deg);
}

.home-scene-plant::after {
  right: 3px;
  transform: rotate(24deg);
}

.home-scene-clothes {
  left: 80px;
  display: grid;
  gap: 4px;
}

.home-scene-clothes span {
  display: block;
  width: 66px;
  height: 12px;
  border-radius: 8px;
  background: var(--warm-scene-cloth-pink);
  box-shadow: var(--warm-scene-shadow);
}

.home-scene-clothes span:nth-child(2) {
  width: 60px;
  background: var(--warm-scene-cloth-cream);
}

.home-scene-clothes span:nth-child(3) {
  width: 56px;
  background: var(--warm-scene-cloth-soft);
}

.home-scene-bear {
  left: 168px;
  width: 58px;
  height: 64px;
  border-radius: 28px 28px 24px 24px;
  background: linear-gradient(180deg, var(--warm-scene-bear-start) 0%, var(--warm-scene-bear-end) 100%);
}

.home-scene-bear .ear {
  position: absolute;
  top: -10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--warm-scene-bear-ear);
}

.home-scene-bear .ear.left {
  left: 8px;
}

.home-scene-bear .ear.right {
  right: 8px;
}

.home-scene-bear .face {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 22px;
  height: 18px;
  border-radius: 12px;
  background: var(--warm-scene-bear-face);
}

.home-scene-rainbow {
  left: 248px;
  display: flex;
  align-items: flex-end;
  gap: 0;
  width: 64px;
  height: 44px;
}

.home-scene-rainbow span {
  position: absolute;
  inset: auto 0 0;
  border-top-left-radius: 44px;
  border-top-right-radius: 44px;
  border: 6px solid transparent;
  border-bottom: 0;
}

.home-scene-rainbow span:nth-child(1) {
  height: 44px;
  border-color: var(--warm-scene-rainbow-outer);
  border-bottom: 0;
}

.home-scene-rainbow span:nth-child(2) {
  left: 8px;
  right: 8px;
  height: 32px;
  border-color: var(--warm-scene-rainbow-mid);
  border-bottom: 0;
}

.home-scene-rainbow span:nth-child(3) {
  left: 16px;
  right: 16px;
  height: 20px;
  border-color: var(--warm-scene-rainbow-inner);
  border-bottom: 0;
}

.home-scene-car {
  left: 326px;
  width: 48px;
  height: 18px;
  border-radius: 12px 14px 8px 8px;
  background: var(--warm-scene-car);
}

.home-scene-car::before,
.home-scene-car::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warm-scene-wheel);
}

.home-scene-car::before {
  left: 7px;
}

.home-scene-car::after {
  right: 7px;
}

.home-scene-leaf {
  right: 24px;
  width: 40px;
  height: 50px;
  border-radius: 0 0 18px 18px;
  background: var(--warm-scene-pot);
}

.home-scene-leaf::before {
  left: 4px;
  transform: rotate(-18deg);
}

.home-scene-leaf::after {
  right: 4px;
  transform: rotate(20deg);
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-stat-card,
.home-panel,
.home-quick-card,
.home-draft-card,
.home-empty-card {
  border: 1px solid var(--warm-border);
  border-radius: 16px;
  background: var(--warm-surface);
  box-shadow: var(--warm-shadow);
}

.home-stat-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 18px 16px;
}

.home-stat-icon,
.home-quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.home-stat-icon svg,
.home-quick-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.home-stat-icon {
  width: 56px;
  height: 56px;
  font-size: 24px;
}

.home-stat-card[data-tone="orange"] .home-stat-icon,
.home-quick-icon[data-tone="quote"] {
  background: var(--warm-orange-soft);
  color: var(--warm-orange);
}

.home-stat-card[data-tone="blue"] .home-stat-icon,
.home-quick-icon[data-tone="list"],
.home-quick-icon[data-tone="task"] {
  background: var(--warm-blue-soft);
  color: var(--warm-blue);
}

.home-stat-card[data-tone="green"] .home-stat-icon,
.home-quick-icon[data-tone="alibaba"],
.home-quick-icon[data-tone="import"] {
  background: var(--warm-green-soft);
  color: var(--warm-green);
}

.home-stat-card[data-tone="gold"] .home-stat-icon,
.home-quick-icon[data-tone="customers"],
.home-quick-icon[data-tone="trash"] {
  background: var(--warm-gold-bg);
  color: var(--warm-gold);
}

.home-stat-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.home-stat-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-stat-topline span {
  color: var(--warm-label-text);
  font-size: 15px;
  font-weight: 700;
}

.home-stat-body strong {
  color: var(--warm-text);
  font-size: 18px;
  line-height: 1.2;
}

.home-stat-body p {
  margin: 0;
  color: var(--warm-muted);
  font-size: 13px;
}

.home-soft-button,
.home-link-button,
.home-soft-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--warm-border);
  background: var(--warm-soft-button-bg);
  color: var(--warm-action);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.home-soft-button {
  cursor: pointer;
  transition:
    background-color 0.14s ease,
    transform 0.14s ease,
    border-color 0.14s ease;
}

.home-soft-button:hover,
.home-link-button:hover {
  background: var(--warm-soft-button-hover);
  border-color: var(--warm-border-strong);
  transform: translateY(-1px);
}

.home-soft-badge {
  justify-self: start;
}

.home-stat-card > .home-soft-button,
.home-stat-card > .home-soft-badge {
  grid-column: 2;
  justify-self: start;
  margin-top: 4px;
}

.home-exchange-panel {
  padding: 0;
  overflow: hidden;
}

.home-exchange-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px 15px;
}

.home-exchange-head h3,
.home-exchange-head p {
  margin: 0;
}

.home-exchange-head p {
  margin-top: 4px;
  color: var(--warm-muted-strong);
  font-size: 13px;
}

.home-exchange-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-exchange-title-row h3 {
  color: var(--warm-text);
  font-size: 18px;
}

.home-reference-badge,
.home-exchange-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--warm-border);
  border-radius: 999px;
  background: var(--warm-surface-soft);
  color: var(--warm-muted-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.home-exchange-state[data-stale="true"] {
  border-color: var(--warm-highlight-line);
  background: var(--warm-gold-bg);
  color: var(--warning);
}

.home-exchange-content {
  border-top: 1px solid var(--warm-border-soft);
}

.home-exchange-list {
  display: grid;
}

.home-exchange-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) repeat(3, minmax(110px, 1fr));
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 14px 18px;
}

.home-exchange-row + .home-exchange-row {
  border-top: 1px solid var(--warm-border-soft);
}

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

.home-currency-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 32px;
  border-radius: 10px;
  background: var(--warm-blue-bg);
  color: var(--warm-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.home-exchange-currency div,
.home-exchange-value {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.home-exchange-currency strong,
.home-exchange-value strong {
  color: var(--warm-text);
  font-size: 16px;
}

.home-exchange-currency small,
.home-exchange-value span {
  color: var(--warm-muted-strong);
  font-size: 12px;
}

.home-exchange-value.primary strong {
  color: var(--warm-action-strong);
  font-size: 20px;
}

.home-exchange-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--warm-border-soft);
  background: var(--warm-surface-soft);
  color: var(--warm-muted-strong);
  font-size: 12px;
}

.home-exchange-meta p {
  margin: 0;
}

.home-exchange-loading {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 18px;
  padding: 26px 18px;
}

.home-rate-skeleton {
  display: block;
  height: 15px;
  max-width: 160px;
  border-radius: 999px;
  background: var(--warm-border-soft);
  animation: home-rate-pulse 1.4s ease-in-out infinite;
}

.home-rate-skeleton.wide {
  max-width: 220px;
}

.home-exchange-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 16px 18px;
  color: var(--warm-muted-strong);
}

.home-exchange-error p {
  margin: 0;
}

@keyframes home-rate-pulse {
  0%, 100% { opacity: .52; }
  50% { opacity: 1; }
}

.home-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.home-panel {
  padding: 18px;
}

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

.home-panel-head h3 {
  margin: 0 0 2px;
  color: var(--warm-text);
  font-size: 22px;
}

.home-panel-head p {
  margin: 0;
  color: var(--warm-muted);
  font-size: 13px;
}

.home-continue-list {
  display: grid;
}

.home-continue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 10px;
  border-top: 1px solid var(--warm-border-soft);
}

.home-continue-row:first-child {
  border-top: 1px solid var(--warm-border-soft);
}

.home-continue-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.home-continue-copy {
  min-width: 0;
}

.home-continue-copy strong,
.home-draft-body strong {
  display: block;
  color: var(--warm-text);
  font-size: 16px;
}

.home-continue-copy p,
.home-draft-body p,
.home-draft-body small {
  margin: 2px 0 0;
  color: var(--warm-muted);
  font-size: 13px;
  line-height: 1.45;
}

.home-type-badge,
.home-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.home-type-badge[data-tone="orange"],
.home-status-badge[data-tone="orange"] {
  background: var(--warm-orange-bg);
  color: var(--warm-orange-label);
}

.home-type-badge[data-tone="blue"],
.home-status-badge[data-tone="blue"] {
  background: var(--warm-blue-bg);
  color: var(--warm-blue-label);
}

.home-type-badge[data-tone="green"],
.home-status-badge[data-tone="green"] {
  background: var(--warm-green-bg);
  color: var(--warm-green-label);
}

.home-type-badge[data-tone="purple"],
.home-status-badge[data-tone="purple"] {
  background: var(--warm-purple-bg);
  color: var(--warm-purple);
}

.home-type-badge[data-tone="completed"],
.home-status-badge[data-tone="completed"] {
  background: var(--warm-completed-bg);
  color: var(--warm-completed);
}

.home-continue-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-row-time {
  color: var(--warm-muted);
  font-size: 13px;
  white-space: nowrap;
}

.home-row-arrow {
  color: var(--warm-arrow);
  font-size: 22px;
  line-height: 1;
}

.home-quick-panel {
  position: relative;
  overflow: hidden;
}

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

.home-quick-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 120px;
  padding: 16px 12px;
  text-align: center;
  transition:
    transform 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.home-quick-card:hover {
  transform: translateY(-2px);
  background: var(--warm-surface-hover);
  border-color: var(--warm-border-strong);
  box-shadow: var(--warm-quick-hover-shadow);
}

.home-quick-icon {
  width: 46px;
  height: 46px;
}

.home-quick-icon svg {
  width: 24px;
  height: 24px;
}

.home-quick-card strong,
.home-empty-card strong {
  color: var(--warm-text);
  font-size: 15px;
}

.home-quick-card span,
.home-empty-card p {
  color: var(--warm-muted);
  font-size: 12px;
  line-height: 1.5;
}

.home-quick-decor {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  opacity: 0.88;
}

.home-quick-decor .stack,
.home-quick-decor .bottle,
.home-quick-decor .leaf {
  display: block;
}

.home-quick-decor .stack {
  width: 26px;
  height: 32px;
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(180deg, var(--warm-quick-stack-start), var(--warm-quick-stack-end));
}

.home-quick-decor .bottle {
  width: 16px;
  height: 34px;
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(180deg, var(--warm-quick-bottle-start), var(--warm-quick-bottle-end));
}

.home-quick-decor .leaf {
  width: 28px;
  height: 42px;
  border-radius: 14px 14px 10px 10px;
  background: var(--warm-quick-pot);
  position: relative;
}

.home-quick-decor .leaf::before,
.home-quick-decor .leaf::after {
  content: "";
  position: absolute;
  bottom: 28px;
  width: 12px;
  height: 18px;
  border-radius: 12px 12px 2px 12px;
  background: var(--warm-scene-plant-green);
}

.home-quick-decor .leaf::before {
  left: 3px;
  transform: rotate(-18deg);
}

.home-quick-decor .leaf::after {
  right: 3px;
  transform: rotate(20deg);
}

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

.home-draft-card {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.home-draft-image .product-image,
.home-draft-image .product-image-placeholder {
  width: 100%;
  height: 126px;
  border-radius: 10px;
}

.home-draft-image .product-image {
  object-fit: contain;
  background: var(--warm-surface-soft);
}

.home-draft-body {
  min-width: 0;
}

.home-draft-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.home-empty-card {
  display: grid;
  gap: 8px;
  padding: 22px;
}

.home-empty-card.compact {
  min-height: 160px;
}

.header-title-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.header-subtitle {
  margin: 0;
  color: var(--warm-muted);
  font-size: 13px;
  line-height: 1.45;
}

.subview-tabs {
  display: flex;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}

.outer-subview-tabs {
  margin: 0 0 16px;
}

.subview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.subview-tab {
  min-height: 38px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface);
  color: var(--warm-muted-strong);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

.subview-tab.active {
  border-color: var(--warm-highlight-line);
  background: var(--warm-highlight);
  color: var(--warm-action-strong);
}

.subview-panel {
  display: none;
}

.subview-panel.active {
  display: block;
}

.trash-bulk-toolbar {
  margin: 10px 0 16px;
}

.trash-bulk-toolbar .table-tools {
  gap: 8px;
}

#trash-view th input[type="checkbox"],
#trash-view td input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.header-title-with-back {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-items: start;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.header-back-button {
  min-width: 116px;
  min-height: 36px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-soft-button-bg);
  color: var(--warm-action);
  box-shadow: var(--warm-shadow-soft);
  white-space: nowrap;
  flex: 0 0 auto;
  gap: 8px;
}

.header-back-button::before {
  content: "←";
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
}

.header-back-button:hover {
  border-color: var(--warm-border-strong);
  background: var(--warm-soft-button-hover);
  box-shadow: var(--warm-shadow-soft);
}

.header-back-button:focus-visible {
  outline: 0;
  border-color: var(--warm-highlight-line);
  box-shadow: 0 0 0 4px rgba(201, 138, 58, 0.14);
}

.product-list-detail-header {
  display: grid;
  gap: 14px;
  margin-bottom: 8px;
}

.product-list-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.product-list-floating-back {
  align-self: flex-start;
}

.product-list-detail-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  align-items: start;
  gap: 24px;
}

.quote-detail-header {
  margin-bottom: 16px;
}

.quote-detail-summary {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 620px);
}

.product-list-title-stack {
  gap: 4px;
  min-width: 0;
}

.product-list-title-stack h2 {
  margin-bottom: 2px;
  max-width: 880px;
  line-height: 1.15;
}

.product-list-detail-topbar .header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.product-list-meta-block {
  display: grid;
  gap: 8px;
  min-width: 360px;
  max-width: 560px;
  padding: 10px 14px;
  border: 1px solid var(--warm-border);
  border-radius: 14px;
  background: var(--warm-surface-soft);
}

.product-list-meta-block .header-subtitle {
  margin: 0;
  word-break: break-word;
}

.compact-result {
  margin: 0 0 10px;
}

.compact-product-info-layout {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
}

.eyebrow {
  margin: 0;
  color: var(--warm-kicker);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.quote-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
  gap: 20px;
  align-items: start;
}

.task-center-shell {
  display: grid;
  gap: 18px;
}

.task-center-stats,
.task-center-admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.task-center-stat-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--warm-border);
  border-radius: 16px;
  background: var(--warm-surface);
  box-shadow: var(--warm-shadow-soft);
}

.task-center-stat-card span {
  color: var(--warm-label-text);
  font-size: 13px;
  font-weight: 700;
}

.task-center-stat-card strong {
  color: var(--warm-text);
  font-size: 24px;
  line-height: 1;
}

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

.task-center-table-scroll {
  max-height: min(440px, 56vh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.task-center-table-scroll table {
  min-width: 680px;
}

.task-center-table-scroll thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: var(--warm-surface);
  box-shadow: 0 1px 0 var(--warm-border-soft);
}

.task-center-table-scroll:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.task-center-sales-scroll table {
  min-width: 880px;
}

.table-subtext {
  margin-top: 4px;
  color: var(--warm-muted);
  font-size: 12px;
}

.quote-editor-stack {
  display: grid;
  gap: 20px;
}

.form-page-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(420px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.product-list-panel {
  padding: 20px;
}

.panel {
  border: 1px solid var(--warm-border);
  border-radius: 16px;
  background: var(--warm-surface);
  box-shadow: var(--warm-shadow);
  padding: 18px;
}

.panel h3 {
  margin: 0 0 16px;
  color: var(--warm-text);
  font-size: 18px;
}

.helper-text {
  margin: 10px 0 10px;
  color: var(--warm-muted);
  font-size: 13px;
  line-height: 1.5;
}

.import-template {
  display: block;
  margin-bottom: 12px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface-soft);
  color: var(--warm-text-soft);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px;
  white-space: normal;
}

.import-result {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--warm-action-strong);
  font-size: 13px;
  font-weight: 800;
}

.auth-card .import-result {
  min-height: 0;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  line-height: 1.5;
  transition: background-color 0.15s ease, color 0.15s ease, padding 0.15s ease, border-color 0.15s ease;
}

.auth-card .import-result:not([hidden]) {
  padding: 10px 12px;
  border: 1px solid var(--warm-border);
  background: var(--warm-surface-soft);
}

.auth-card .import-result[data-tone="danger"] {
  color: #b42318;
  border-color: #f3c7c2;
  background: #fff1f1;
}

.auth-card .import-result[data-tone="warning"] {
  color: #9a6700;
  border-color: #f4d38d;
  background: #fff7e6;
}

.auth-card .import-result[data-tone="success"] {
  color: var(--warm-green-label);
  border-color: rgba(122, 155, 89, 0.18);
  background: var(--warm-green-bg);
}

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

.file-import-field {
  border: 1px dashed var(--warm-border);
  border-radius: 14px;
  background: var(--warm-surface-soft);
  padding: 14px;
}

.image-field-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--warm-border);
  border-radius: 14px;
  background: var(--warm-surface-soft);
  padding: 14px;
}

.image-field-panel.compact {
  margin: 4px 0 8px;
}

.image-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--warm-text);
  font-weight: 700;
}

.image-field-header small {
  color: var(--warm-muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.product-editor-image-gallery {
  display: flex;
  min-height: 112px;
  gap: 10px;
  overflow-x: auto;
  padding: 2px;
}

.product-editor-image-gallery > .image-field-empty {
  display: grid;
  flex: 1;
  min-width: 180px;
  place-items: center;
  border: 1px dashed var(--warm-border);
  border-radius: 12px;
  color: var(--warm-muted-strong);
  font-size: 13px;
}

.product-editor-image-item {
  position: relative;
  flex: 0 0 120px;
  overflow: hidden;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: #fff;
}

.product-editor-image-item.is-primary {
  border-color: var(--warm-accent);
  box-shadow: 0 0 0 2px rgba(201, 138, 58, 0.16);
}

.product-editor-image-item img {
  display: block;
  width: 120px;
  height: 112px;
  object-fit: cover;
}

.product-editor-image-item-actions {
  position: absolute;
  inset: auto 6px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.product-editor-image-item-actions .secondary-button {
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(255, 253, 252, 0.94);
  font-size: 11px;
}

.product-editor-image-primary {
  border-radius: 999px;
  background: rgba(87, 119, 54, 0.92);
  color: #fff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.product-editor-image-item-actions .icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 253, 252, 0.94);
}

@media (max-width: 560px) {
  .product-editor-image-item,
  .product-editor-image-item img {
    width: 104px;
  }

  .product-editor-image-item {
    flex-basis: 104px;
  }
}

.image-field-preview {
  position: relative;
  min-height: 180px;
  border: 1px dashed var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px;
}

.image-field-preview[hidden] {
  display: none !important;
}

.product-image-panel {
  gap: 8px;
  padding: 12px 14px;
}

.product-image-panel .image-field-preview {
  min-height: 120px;
}

.image-field-preview img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 6px;
}

.image-field-empty {
  color: var(--warm-muted);
  font-size: 13px;
}

.image-field-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.image-picker-button {
  position: relative;
  overflow: hidden;
}

.image-picker-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.settings-panel {
  max-width: 980px;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.setting-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--warm-border);
  border-radius: 14px;
  padding: 16px;
  background: var(--warm-surface-soft);
}

.setting-card h4 {
  margin: 0;
  color: var(--warm-text);
  font-size: 16px;
}

.settings-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-action-grid button {
  min-width: 108px;
}

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

.setting-option-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 76px;
  border: 1px solid var(--warm-border);
  border-radius: 14px;
  padding: 12px;
  background: var(--warm-surface);
  cursor: pointer;
}

.setting-option-card.active {
  border-color: var(--warm-highlight-line);
  background: rgba(243, 223, 194, 0.42);
  box-shadow: var(--warm-shadow-soft);
}

.setting-option-card input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin-top: 4px;
}

.setting-option-card strong,
.setting-option-card small {
  display: block;
}

.setting-option-card strong {
  color: var(--warm-text);
}

.setting-option-card small {
  margin-top: 4px;
  color: var(--warm-muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field span {
  color: var(--warm-text);
  font-size: 13px;
  font-weight: 800;
}

.settings-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface);
  color: var(--warm-text);
  padding: 10px 12px;
  font: inherit;
}

.settings-field input:focus {
  outline: none;
  border-color: var(--warm-highlight-line);
  box-shadow: 0 0 0 3px rgba(201, 138, 58, 0.12);
}

.settings-field-full {
  grid-column: 1 / -1;
}

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

.warehouse-settings-row {
  align-items: center;
  background: var(--surface-soft, #fffaf3);
  border: 1px solid var(--line, #ead8c0);
  border-radius: 14px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 14px;
}

.warehouse-settings-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.warehouse-settings-row span,
.warehouse-settings-row small {
  color: var(--muted, #806f60);
}

.warehouse-settings-edit {
  align-items: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(220px, 2fr) auto;
}

.warehouse-settings-edit label {
  display: grid;
  font-size: .82rem;
  gap: 5px;
}

.warehouse-settings-edit input {
  min-width: 0;
  width: 100%;
}

.quote-warehouse-summary {
  background: var(--surface-soft, #fffaf3);
  border: 1px solid var(--line, #ead8c0);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px 14px;
}

.quote-warehouse-summary span {
  color: var(--muted, #806f60);
}

@media (max-width: 900px) {
  .warehouse-settings-edit {
    grid-template-columns: 1fr 1fr;
  }

  .warehouse-settings-edit .warehouse-address-field,
  .warehouse-settings-edit .row-actions {
    grid-column: 1 / -1;
  }
}

.image-remove-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border: 1px solid var(--warm-border);
  border-radius: 999px;
  background: rgba(255, 253, 252, 0.94);
  color: #dc2626;
  box-shadow: var(--warm-shadow-soft);
}

.file-import-field input {
  margin-top: 8px;
  height: auto;
  border: 1px dashed var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface);
  padding: 9px;
  color: var(--warm-muted);
}

.file-import-field input::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 7px;
  background: var(--warm-action);
  color: #ffffff;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.file-import-field input::file-selector-button:hover {
  background: var(--warm-action-strong);
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--warm-text-soft);
  font-size: 13px;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 18px;
}

.field-hint {
  color: var(--warm-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

label:focus-within .field-hint {
  opacity: 1;
}

.field-hint[data-tone="success"] {
  color: var(--warm-action-strong);
}

.field-hint[data-tone="danger"] {
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface);
  color: var(--warm-text);
  outline: 0;
  padding: 10px 11px;
  font-size: 14px;
}

input,
select {
  height: 41px;
}

input[readonly] {
  background: var(--warm-surface-soft);
  color: var(--warm-text);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--warm-highlight-line);
  box-shadow: 0 0 0 4px rgba(201, 138, 58, 0.12);
}

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

.form-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.form-grid.thirds {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-editor-stack .quote-form .form-grid:not(.single) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quote-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.quote-form h3 {
  font-size: 16px;
  margin-bottom: 0;
}

.quote-form-section {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface-soft);
}

.quote-form .quote-main-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quote-cost-grid {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.quote-form label {
  gap: 6px;
  font-size: 13px;
  color: var(--warm-text-soft);
  font-weight: 700;
}

.quote-form input,
.quote-form select {
  height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.quote-form textarea {
  min-height: 72px;
  padding: 10px 11px;
  font-size: 13px;
}

.quote-modal-form {
  gap: 12px;
}

.quote-modal-form .quote-meta-top-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-modal-form .quote-meta-trade-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quote-modal-form .quote-meta-cost-grid {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.quote-modal-form .quote-meta-payment-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-meta-notes {
  gap: 6px;
}

.quote-meta-notes textarea {
  min-height: 74px;
}

.form-error {
  margin: -4px 0 12px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.form-error[hidden] {
  display: none;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  border-color: var(--warm-action);
  background: var(--warm-action);
  color: #ffffff;
  box-shadow: var(--warm-shadow-soft);
}

.primary-button:hover {
  background: var(--warm-action-strong);
  border-color: var(--warm-action-strong);
}

.secondary-button,
.icon-button {
  border-color: var(--warm-border);
  background: var(--warm-soft-button-bg);
  color: var(--warm-action);
}

.danger-button {
  border-color: #efc7c0;
  background: #fff2ef;
  color: #b14f42;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(89, 62, 38, 0.24);
  padding: 20px;
}

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

#import-sync-modal {
  z-index: 30;
}

#product-import-duplicate-modal,
#import-preview-modal,
#factory-product-modal {
  z-index: 40;
}

#image-preview-modal {
  z-index: 90;
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  border: 1px solid var(--warm-border);
  border-radius: 16px;
  background: var(--warm-surface);
  box-shadow: 0 24px 80px rgba(120, 80, 40, 0.18);
  overflow-y: auto;
  padding: 20px;
}

.large-modal-card {
  width: min(760px, 100%);
}

.quote-meta-modal-card {
  width: min(980px, 100%);
}

.target-picker-modal {
  width: min(860px, 100%);
}

.target-picker-actions {
  margin: 8px 0 18px;
}

.target-picker-records h4 {
  margin: 0 0 12px;
  font-size: 18px;
}

.picker-record-list {
  display: grid;
  gap: 12px;
  max-height: 360px;
  overflow: auto;
}

.picker-record-item {
  width: 100%;
  border: 1px solid var(--warm-border);
  border-radius: 14px;
  background: var(--warm-surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}

.picker-record-item strong {
  font-size: 17px;
}

.picker-record-item span {
  color: var(--warm-muted);
  font-size: 14px;
}

.picker-record-item:hover {
  border-color: var(--warm-highlight-line);
  background: var(--warm-surface-hover);
  box-shadow: var(--warm-shadow-soft);
}

.compact-empty-state {
  padding: 20px;
  text-align: center;
}

.quick-product-form {
  gap: 6px;
}

.product-create-choice-modal {
  width: min(560px, 100%);
}

.product-create-choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.product-import-modal {
  width: min(820px, 100%);
}

.product-import-modal .import-panel {
  display: grid;
  gap: 14px;
}

.product-import-modal .import-panel h3,
.product-import-modal .import-panel p {
  margin: 0;
}

#product-editor-modal .modal-card {
  width: min(980px, 100%);
}

#product-editor-modal .product-form {
  display: grid;
  gap: 8px;
}

#product-editor-modal label {
  gap: 5px;
  margin-bottom: 8px;
}

#product-editor-modal .form-grid {
  gap: 10px 12px;
}

.product-editor-wide-field,
.quick-product-wide-field {
  width: 100%;
}

.product-editor-grid-top {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-editor-grid-middle {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-editor-grid-bottom {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--warm-border);
  padding-bottom: 14px;
}

.modal-header h3 {
  margin: 3px 0 0;
  font-size: 22px;
}

.modal-subtitle {
  margin: 6px 0 0;
  color: var(--warm-muted);
  font-size: 13px;
}

.confirm-summary {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.confirm-summary p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface-soft);
  padding: 10px 12px;
}

.confirm-summary span {
  color: var(--warm-muted);
  font-size: 13px;
}

.confirm-summary strong {
  color: var(--warm-text);
}

.confirm-summary .confirm-total {
  border-color: var(--warm-highlight-line);
  background: rgba(243, 223, 194, 0.42);
}

.confirm-summary .confirm-total strong {
  color: var(--warm-action-strong);
  font-size: 18px;
}

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

.detail-image-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.server-settings-form {
  margin-top: 16px;
}

.backup-center-modal {
  width: min(760px, 100%);
}

.backup-center-modal .helper-text {
  margin: 16px 0 0;
  padding-top: 2px;
}

#update-center-modal .backup-center-modal {
  width: min(900px, 100%);
}

.desktop-update-hero {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid var(--warm-border);
  border-radius: 16px;
  background: var(--warm-surface-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.desktop-update-hero.has-update {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
}

.desktop-update-hero.is-current {
  border-color: #c8d7ff;
  background: linear-gradient(135deg, #eef3ff 0%, #eef3ff 100%);
}

.desktop-update-hero h4 {
  margin: 8px 0 8px;
  color: var(--warm-text);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
}

.desktop-update-hero p {
  margin: 0;
  max-width: 620px;
  color: var(--warm-muted);
  font-weight: 800;
  line-height: 1.65;
}

.desktop-update-hero > strong {
  flex: 0 0 auto;
  color: var(--green-dark);
  font-size: 30px;
  font-weight: 900;
  white-space: nowrap;
}

.desktop-update-hero.has-update > strong {
  color: #b45309;
}

.desktop-update-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.92);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}

.desktop-update-hero.has-update .desktop-update-pill {
  color: #b45309;
}

.desktop-update-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.desktop-update-summary > div {
  min-height: 70px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.desktop-update-summary span {
  color: var(--warm-muted);
  font-size: 12px;
  font-weight: 800;
}

.desktop-update-summary strong {
  color: var(--warm-text);
  font-size: 18px;
  font-weight: 900;
}

.desktop-update-detail {
  margin-top: 14px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface);
  padding: 16px 18px;
}

.desktop-update-detail h4 {
  margin: 0 0 10px;
  color: var(--warm-text);
  font-size: 15px;
  font-weight: 900;
}

.desktop-update-detail p {
  margin: 0;
  color: var(--warm-muted);
  line-height: 1.65;
  font-weight: 700;
}

.desktop-update-notes-card {
  border-color: rgba(122, 155, 89, 0.18);
  background: rgba(237, 246, 230, 0.36);
}

.desktop-update-notes-card h4 {
  color: var(--green-dark);
}

.desktop-update-notes ol {
  margin: 0;
  padding-left: 0;
  color: var(--warm-text);
  list-style: none;
  counter-reset: updateNotes;
}

.desktop-update-notes li {
  position: relative;
  margin: 10px 0;
  padding: 12px 14px 12px 48px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface);
  line-height: 1.55;
  font-weight: 800;
  counter-increment: updateNotes;
}

.desktop-update-notes li::before {
  content: counter(updateNotes);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(122, 155, 89, 0.14);
  color: var(--green-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

.desktop-update-progress {
  height: 10px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(122, 155, 89, 0.16);
}

.desktop-update-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
  transition: width 180ms ease;
}

.backup-actions {
  margin-top: 16px;
  margin-bottom: 10px;
}

.backup-table-wrap {
  max-height: 360px;
}

.import-sync-modal {
  width: min(480px, 100%);
}

#close-import-sync[hidden] {
  display: none !important;
}

.import-sync-body {
  display: block;
  padding: 18px 0 8px;
}

.import-sync-lines {
  min-width: 0;
}

.import-sync-message {
  margin: 0 0 6px;
  color: var(--warm-text);
  font-size: 16px;
  font-weight: 800;
}

.import-sync-progress {
  margin: 8px 0 0;
  font-weight: 800;
}

.import-sync-step-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.import-sync-step {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface-soft);
  padding: 10px 12px;
}

.import-sync-step-indicator {
  width: 18px;
  height: 18px;
  border: 2px solid var(--warm-border-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.import-sync-step.active .import-sync-step-indicator {
  border-color: var(--warm-action);
  border-top-color: var(--warm-action-strong);
  animation: import-spin 0.8s linear infinite;
}

.import-sync-step.completed {
  border-color: rgba(122, 155, 89, 0.18);
  background: rgba(237, 246, 230, 0.58);
}

.import-sync-step.completed .import-sync-step-indicator {
  border-color: #10b981;
  background: #10b981;
  color: #ffffff;
  animation: none;
}

.import-sync-step.failed {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
}

.import-sync-step.failed .import-sync-step-indicator {
  border-color: #ef4444;
  background: #ef4444;
  color: #ffffff;
  animation: none;
}

.import-sync-step-label {
  color: var(--warm-text);
  font-size: 14px;
  font-weight: 800;
}

.import-sync-step-meta {
  color: var(--warm-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.import-sync-results {
  margin-top: 18px;
  border-top: 1px solid var(--warm-border);
  padding-top: 16px;
}

.import-sync-results[hidden] {
  display: none;
}

.import-sync-results h4 {
  margin: 0 0 10px;
  color: var(--warm-text);
  font-size: 14px;
}

.import-sync-results ul {
  display: grid;
  gap: 8px;
  max-height: 260px;
  margin: 0;
  padding: 0 2px 0 0;
  overflow: auto;
  list-style: none;
}

.import-sync-result-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--warm-border);
  border-radius: 10px;
  padding: 10px;
  background: var(--warm-surface-soft);
}

.import-sync-result-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--warm-green-bg);
  color: var(--warm-green-label);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.import-sync-result-item.warning .import-sync-result-status {
  background: #fff2ef;
  color: #b14f42;
}

.import-sync-result-content {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.import-sync-result-content strong,
.import-sync-result-content small {
  overflow-wrap: anywhere;
}

.import-sync-result-content strong {
  color: var(--warm-text);
  font-size: 13px;
}

.import-sync-result-content small {
  color: var(--warm-muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

@keyframes import-spin {
  to {
    transform: rotate(360deg);
  }
}

.image-choice-modal {
  width: min(620px, 100%);
}

.image-choice-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.image-choice-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--warm-border);
  border-radius: 12px;
  background: var(--warm-surface-soft);
  padding: 10px 12px;
}

.image-choice-meta {
  min-width: 0;
}

.image-choice-meta strong,
.image-choice-meta span {
  display: block;
}

.image-choice-meta strong {
  color: var(--warm-text);
  font-size: 14px;
}

.image-choice-meta span {
  color: var(--warm-muted);
  font-size: 12px;
  line-height: 1.5;
}

.duplicate-import-modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.duplicate-import-list {
  display: grid;
  gap: 14px;
  margin: 14px 0 18px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.duplicate-import-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--warm-border);
  border-radius: 14px;
  background: var(--warm-surface-soft);
  padding: 14px;
}

.duplicate-import-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.duplicate-import-header strong {
  font-size: 15px;
}

.duplicate-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.duplicate-summary-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--warm-surface);
  color: var(--warm-text-soft);
  font-size: 12px;
  font-weight: 700;
}

.duplicate-summary-badge.same {
  background: var(--warm-green-bg);
  color: var(--warm-green-label);
}

.duplicate-summary-badge.diff {
  background: var(--warm-orange-bg);
  color: var(--warm-orange-label);
}

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

.duplicate-import-panel,
.duplicate-profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.duplicate-import-panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.duplicate-compare-table {
  display: grid;
  gap: 8px;
}

.duplicate-profile-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.duplicate-profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.duplicate-profile-head .duplicate-preview-title {
  grid-column: 1 / -1;
  width: fit-content;
}

.duplicate-profile-fields {
  display: grid;
  gap: 8px;
}

.duplicate-profile-field {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 10px;
  background: #f8fafc;
}

.duplicate-profile-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duplicate-profile-field strong {
  color: var(--ink);
  font-size: 13px;
  word-break: break-word;
}

.duplicate-profile-field.same {
  background: #eef3ff;
  border-color: rgba(0, 22, 70, 0.2);
}

.duplicate-profile-field.diff {
  background: #fff7ed;
  border-color: rgba(245, 158, 11, 0.22);
}

.duplicate-compare-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid transparent;
}

.duplicate-compare-label {
  display: grid;
  gap: 4px;
}

.duplicate-compare-label span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.duplicate-compare-label strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.duplicate-compare-value {
  display: grid;
  gap: 4px;
}

.duplicate-compare-value small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.duplicate-compare-value strong {
  color: var(--ink);
  font-size: 13px;
  word-break: break-word;
}

.duplicate-compare-row.same {
  background: #eef3ff;
  border: 1px solid rgba(0, 22, 70, 0.2);
}

.duplicate-compare-row.diff {
  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.duplicate-import-actions {
  display: flex;
  justify-content: flex-end;
}

.duplicate-import-modal .modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.duplicate-import-modal .modal-actions .checkbox-row {
  flex: 1 1 280px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 12px;
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.duplicate-import-modal .modal-actions .checkbox-row:has(input:checked) {
  border-color: rgba(0, 22, 70, 0.32);
  background: rgba(0, 22, 70, 0.08);
}

.duplicate-import-modal .modal-actions .secondary-button {
  flex: 0 0 auto;
}

.duplicate-import-modal .checkbox-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.checkbox-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  border-radius: 999px;
  background: var(--color-disabled);
  transition: background-color 0.16s ease;
}

.checkbox-switch::after {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(120, 80, 40, 0.16);
  content: "";
  transition: transform 0.16s ease;
}

.checkbox-row input:checked + .checkbox-switch {
  background: var(--accent);
}

.checkbox-row input:checked + .checkbox-switch::after {
  transform: translateX(18px);
}

.duplicate-preview-card {
  align-items: start;
  gap: 10px;
}

.duplicate-preview-title {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--warm-surface-soft);
  color: var(--warm-text);
  font-size: 12px;
  font-weight: 800;
}

.duplicate-import-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.import-preview-modal {
  width: min(980px, 100%);
}

.import-preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 14px;
}

.import-preview-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--warm-surface-soft);
  color: var(--warm-text-soft);
  font-size: 12px;
  font-weight: 800;
}

.import-preview-badge.warning {
  background: var(--warm-orange-bg);
  color: var(--warm-orange-label);
}

.import-preview-badge.danger {
  background: #fef2f2;
  color: #991b1b;
}

.import-preview-badge.success {
  background: var(--warm-green-bg);
  color: var(--warm-green-label);
}

.import-preview-badge.neutral {
  background: var(--warm-surface-soft);
  color: var(--warm-text-soft);
}

.current-record-badge {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  vertical-align: middle;
}

.quote-manage-table,
.product-list-manage-table {
  table-layout: fixed;
  width: 100%;
}

.quote-manage-table th:nth-child(1),
.quote-manage-table td:nth-child(1) {
  width: 18%;
}

.quote-manage-table th:nth-child(2),
.quote-manage-table td:nth-child(2) {
  width: 20%;
}

.quote-manage-table th:nth-child(3),
.quote-manage-table td:nth-child(3) {
  width: 24%;
}

.quote-manage-table th:nth-child(4),
.quote-manage-table td:nth-child(4) {
  width: 16%;
}

.quote-manage-table th:nth-child(5),
.quote-manage-table td:nth-child(5) {
  width: 8%;
}

.quote-manage-table th:nth-child(6),
.quote-manage-table td:nth-child(6) {
  width: 14%;
}

.product-list-manage-table th:nth-child(1),
.product-list-manage-table td:nth-child(1) {
  width: 18%;
}

.product-list-manage-table th:nth-child(2),
.product-list-manage-table td:nth-child(2) {
  width: 26%;
}

.product-list-manage-table th:nth-child(3),
.product-list-manage-table td:nth-child(3) {
  width: 20%;
}

.product-list-manage-table th:nth-child(4),
.product-list-manage-table td:nth-child(4) {
  width: 12%;
}

.product-list-manage-table th:nth-child(5),
.product-list-manage-table td:nth-child(5) {
  width: 8%;
}

.product-list-manage-table th:nth-child(6),
.product-list-manage-table td:nth-child(6) {
  width: 16%;
}

.quote-manage-table td,
.product-list-manage-table td {
  overflow-wrap: anywhere;
}

.quote-manage-table .action-buttons,
.product-list-manage-table .action-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.quote-manage-table .action-buttons button,
.product-list-manage-table .action-buttons button {
  min-width: 68px;
  white-space: nowrap;
}

.import-preview-table-wrap {
  max-height: 420px;
}

.import-preview-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.import-preview-status.new {
  background: var(--warm-green-bg);
  color: var(--warm-green-label);
}

.import-preview-status.duplicate {
  background: var(--warm-orange-bg);
  color: var(--warm-orange-label);
}

.import-preview-status.warning,
.import-preview-status.invalid {
  background: #fef2f2;
  color: #991b1b;
}

.import-record-detail-modal {
  width: min(900px, 100%);
}

.import-record-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 14px;
}

.import-record-detail-wrap {
  max-height: 420px;
}

.product-record-image-gallery {
  display: flex;
  gap: 8px;
  max-width: 300px;
  overflow-x: auto;
  padding: 2px;
}

.product-record-image-thumb {
  position: relative;
  flex: 0 0 68px;
  width: 68px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--warm-border);
  border-radius: 9px;
  background: var(--warm-surface-soft);
}

.product-record-image-thumb.is-primary {
  border-color: rgba(201, 138, 58, 0.52);
}

.product-record-image-thumb img,
.product-record-image-placeholder {
  display: grid;
  width: 100%;
  height: 52px;
  place-items: center;
  object-fit: cover;
  color: var(--warm-text-soft);
  font-size: 11px;
  font-weight: 800;
}

.product-record-image-thumb figcaption {
  display: block;
  padding: 4px 3px;
  overflow: hidden;
  color: var(--warm-text-soft);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-record-image-empty {
  color: var(--warm-muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.image-preview-modal {
  width: min(1120px, 100%);
}

.image-preview-body {
  display: grid;
  place-items: center;
  min-height: 360px;
  border-radius: 14px;
  background: var(--warm-surface-soft);
  overflow: hidden;
}

.image-preview-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.product-image {
  cursor: zoom-in;
}

@media (max-width: 860px) {
  .duplicate-compare-row {
    grid-template-columns: 1fr;
  }

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

  .duplicate-import-preview-grid {
    grid-template-columns: 1fr;
  }
}

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

#product-library-panel .table-toolbar,
#factory-library-panel .table-toolbar,
#factory-detail-view .table-toolbar {
  position: sticky;
  top: 0;
  z-index: var(--layer-sticky);
  margin: -8px -2px 12px;
  padding: 8px 2px 10px;
  background: rgba(248, 250, 252, 0.96);
  border-bottom: 1px solid rgba(203, 213, 225, 0.75);
  backdrop-filter: blur(10px);
}

.table-toolbar h3 {
  margin: 0;
}

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

.table-toolbar input,
.table-toolbar select {
  max-width: 260px;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.search-field input {
  width: 100%;
  padding-right: 40px;
}

.search-clear-button {
  position: absolute;
  right: 7px;
  top: 50%;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.search-clear-button:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text);
}

.search-clear-button:active {
  background: var(--color-border);
}

.search-clear-button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .search-clear-button,
  .home-rate-skeleton {
    transition: none;
  }

  .home-rate-skeleton {
    animation: none;
  }
}

.table-tools input {
  min-width: 270px;
}

.permission-checks {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.permission-checks legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.permission-checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-weight: 800;
}

.compact-permission-checks {
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
}

.compact-permission-checks label {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 13px;
}

.compact-permission-checks input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

#sales-user-edit-modal .modal-card {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
}

#sales-user-edit-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

#sales-user-edit-form .sales-user-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  align-items: start;
  min-width: 0;
}

#sales-user-edit-form .sales-user-edit-grid > label,
#sales-user-edit-form .sales-user-edit-grid > fieldset,
#sales-user-edit-form .sales-user-edit-grid > p {
  min-width: 0;
}

#sales-user-edit-form .sales-user-edit-position-field {
  grid-column: 1 / 2;
}

#sales-user-edit-form .sales-user-edit-permissions,
#sales-user-edit-form .sales-user-edit-position-hint {
  grid-column: 1 / -1;
}

#sales-user-edit-form .sales-user-edit-permissions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  gap: 10px;
  min-height: 0;
  overflow-x: hidden;
  padding: 12px;
}

#sales-user-edit-form .sales-user-edit-permissions label {
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

#sales-user-edit-form .sales-user-edit-permissions input {
  flex: 0 0 auto;
}

#sales-user-edit-form .sales-user-edit-position-hint {
  margin: -6px 0 0;
}

#sales-user-edit-form .modal-actions {
  margin-top: 2px;
}

@media (max-width: 640px) {
  #sales-user-edit-modal .modal-card {
    width: calc(100vw - 20px);
    padding: 16px;
  }

  #sales-user-edit-form .sales-user-edit-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #sales-user-edit-form .sales-user-edit-position-field {
    grid-column: 1 / -1;
  }

  #sales-user-edit-form .sales-user-edit-permissions {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  #sales-user-edit-form .modal-actions {
    flex-wrap: wrap;
  }
}

.one-column-grid {
  grid-template-columns: 1fr;
}

.security-admin-grid {
  margin-top: 16px;
  grid-template-columns: 1fr;
}

.security-ip-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(140px, 0.6fr) minmax(220px, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.security-ip-form button {
  min-width: 112px;
}

.security-panel {
  overflow: hidden;
}

.security-toolbar {
  align-items: flex-start;
  gap: 14px;
}

.security-toolbar-copy {
  display: grid;
  gap: 4px;
}

.security-toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.constrained-height {
  max-height: 360px;
  overflow: auto;
}

.session-wrap table {
  min-width: 920px;
}

.wide-table {
  min-width: 100%;
}

.session-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e6f7f5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.session-group-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.security-ip-subtable {
  margin-top: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.success {
  background: var(--warm-green-bg);
  color: var(--warm-green-label);
}

.status-pill.warning {
  background: #fff7e6;
  color: #9a6700;
}

.status-pill.danger {
  background: #fff1f1;
  color: #b42318;
}

.status-pill.risk {
  background: #fdecec;
  color: #991b1b;
  box-shadow: inset 0 0 0 1px #f3b3b3;
}

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

.sales-user-status-tabs {
  margin-top: -4px;
}

.audit-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.risk-text {
  color: #b42318;
  font-weight: 800;
}

.export-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 16px;
}

.export-panel[hidden] {
  display: none;
}

.export-panel h4,
.export-panel p {
  margin: 0;
}

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

.export-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.export-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 10px;
}

.export-field input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

.select-cell {
  width: 42px;
  text-align: center;
}

.select-cell input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

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

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

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

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

td {
  font-size: 14px;
}

.product-visual-cell {
  display: grid;
  grid-template-columns: 74px minmax(140px, 1fr);
  gap: 12px;
  align-items: center;
}

.product-visual-cell strong,
.product-visual-cell small {
  display: block;
}

.product-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remark-badge {
  position: relative;
  display: inline-grid;
  min-height: 22px;
  place-items: center;
  border: 1px solid #facc15;
  border-radius: 999px;
  background: #fef9c3;
  color: #854d0e;
  font-size: 12px;
  font-weight: 900;
  padding: 0 8px;
  white-space: nowrap;
}

.remark-badge:hover::after {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 10;
  width: max-content;
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  content: attr(data-remark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  padding: 10px 12px;
  white-space: normal;
}

.product-visual-cell small {
  margin-top: 4px;
  color: var(--muted);
}

.product-image {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--accent-strong);
  font-weight: 900;
  object-fit: contain;
  object-position: center;
}

img.product-image {
  box-sizing: border-box;
  padding: 4px;
}

.product-image.large {
  width: 100%;
  max-width: 360px;
  height: auto;
  aspect-ratio: 1 / 1;
  font-size: 42px;
}

.product-image.mini {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  font-size: 11px;
}

.product-image.quote {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  font-size: 11px;
}

.product-image-placeholder {
  text-align: center;
}

.product-title {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

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

.inline-edit-button {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  background: #eef3ff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.product-title small {
  color: var(--muted);
  line-height: 1.4;
}

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

.product-row-actions {
  flex-direction: column;
  align-items: flex-start;
}

.row-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 0 9px;
}

.row-actions button[data-factory-action="delete"],
.row-actions button[data-all-product-action="delete"],
.row-actions button[data-trash-action="purge"],
.row-actions button[data-factory-trash-action="purge"] {
  color: var(--danger);
}

.row-actions button[data-trash-action="restore"] {
  background: #eef3ff;
  border-color: #99f6e4;
  color: var(--accent-strong);
}

.row-actions button[data-trash-action="purge"] {
  background: #fff1f0;
  border-color: #fecaca;
  color: var(--danger);
}

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

.link-button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.import-record-actions {
  align-items: center;
}

.import-record-actions button:disabled {
  background: #eef3f7;
  border-color: #d7dee7;
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.product-detail-gallery {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 380px;
}

.product-gallery-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  padding: 6px;
  background: #f8fafc;
  cursor: zoom-in;
}

.product-gallery-image.primary {
  grid-column: 1 / -1;
}

.detail-main {
  display: grid;
  gap: 20px;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.detail-title-row .header-actions button {
  min-width: 92px;
}

.detail-title-row h3 {
  margin: 2px 0 6px;
  font-size: 26px;
}

.detail-title-row p {
  margin: 0;
  color: var(--muted);
}

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

.detail-item {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.detail-item.wide {
  grid-column: 1 / -1;
}

.detail-item.truncate {
  min-width: 0;
}

.detail-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-item strong {
  word-break: break-word;
  font-size: 14px;
}

.product-edit-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-change-detail-button {
  flex: 0 0 auto;
  padding: 0;
  font-size: 12px;
}

.product-change-history-modal-card {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 48px));
}

.product-change-history-list {
  display: grid;
  gap: 12px;
  min-height: 120px;
  max-height: 520px;
  margin-top: 16px;
  padding-right: 4px;
  overflow-y: auto;
}

.product-change-entry {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.product-change-entry-head,
.product-change-entry-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-change-entry-head span,
.product-change-entry-head time,
.product-change-source {
  color: var(--muted);
  font-size: 12px;
}

.product-change-source {
  margin: 5px 0 10px;
}

.product-change-lines {
  display: grid;
  gap: 8px;
}

.product-change-line {
  display: grid;
  grid-template-columns: minmax(76px, 110px) 1fr;
  gap: 12px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.product-change-line > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-change-line p {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.product-change-line del,
.product-change-line ins {
  display: inline-block;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 5px;
  text-decoration: none;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.product-change-line del {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}

.product-change-line ins {
  color: var(--warm-green-label);
  background: var(--warm-green-bg);
}

.detail-item.truncate strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.detail-modal-summary {
  margin-bottom: 12px;
}

.detail-modal-summary h3 {
  margin: 2px 0 6px;
}

.detail-modal-summary p:last-child {
  margin: 0;
  color: var(--muted);
}

#product-list-meta-note-line {
  max-width: 980px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#product-list-view .narrow-field {
  max-width: 98px;
}

#product-list-info-body {
  margin-top: 6px;
}

#product-list-line-table .link-button {
  padding: 0;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

#product-list-picker-table .link-button {
  padding: 0;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

#product-list-picker-table .pick-product-list-item[disabled] {
  opacity: 1;
  cursor: default;
}

.product-list-picker-added-row {
  background: rgba(0, 22, 70, 0.04);
}

.product-list-picker-added-row td {
  background: rgba(0, 22, 70, 0.04);
}

.line-list {
  display: grid;
  gap: 10px;
  min-height: 120px;
}

.empty-state {
  display: grid;
  min-height: 120px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.quote-line-table .line-visual {
  display: grid;
  grid-template-columns: 56px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.quote-line-table .line-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quote-line-table .line-summary strong,
.quote-line-table .line-summary .link-button {
  font-size: 15px;
  font-weight: 800;
}

.quote-line-table .line-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quote-line-table .line-mini-input,
.quote-line-table .line-mid-input {
  min-width: 0;
  height: 36px;
  padding: 7px 9px;
}

.quote-line-table .line-mini-input {
  max-width: 96px;
  text-align: right;
}

.quote-line-table .line-mid-input {
  max-width: 150px;
}

.quote-line-table .line-amount {
  font-weight: 800;
  white-space: nowrap;
}

.quote-line-table .danger-button {
  min-width: 72px;
}

.line-action-stack {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.order-buttons {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-buttons .icon-text-button {
  min-width: 44px;
  height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-buttons .icon-text-button + .icon-text-button {
  border-left: 1px solid var(--line);
}

.order-buttons .icon-text-button:hover:not(:disabled) {
  background: var(--soft);
  color: var(--ink);
}

.order-buttons .icon-text-button:disabled {
  color: var(--color-disabled);
  cursor: not-allowed;
}

.quote-inline-adjustments {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.quote-inline-adjustments label {
  display: grid;
  gap: 8px;
  min-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-inline-adjustments input {
  min-height: 40px;
}

.totals {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.totals div,
.invoice-totals p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
}

.invoice-totals p[hidden] {
  display: none;
}

.invoice-totals .payment-breakdown {
  display: block;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
}

.totals span,
.invoice-totals span {
  color: var(--muted);
}

.grand-total,
.invoice-totals .grand {
  color: var(--accent-strong);
  font-size: 22px;
}

.invoice-document {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: 34px;
  box-shadow: 0 24px 50px rgba(17, 27, 38, 0.08);
}

#invoice-manage-panel {
  display: grid;
  gap: 18px;
}

#invoice-detail-panel[hidden] {
  display: none;
}

.quotation-document {
  position: relative;
  overflow: hidden;
  max-width: 1120px;
  border: 1px solid #e8ddd0;
  background:
    linear-gradient(180deg, #fffefd 0%, #fff9f3 100%);
  padding: 0;
}

.quotation-document.invoice-document {
  box-shadow: 0 24px 48px rgba(92, 70, 44, 0.08);
}

.quotation-document::before {
  content: "";
  display: block;
  height: 10px;
  background: linear-gradient(90deg, #d2a066 0%, #c98a3a 54%, #7d5a38 100%);
}

.quotation-document > .invoice-top,
.quotation-document > .invoice-parties,
.quotation-document > .invoice-bottom {
  margin-left: 34px;
  margin-right: 34px;
}

.invoice-top,
.invoice-parties,
.invoice-bottom,
.signature-row {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 0.75fr);
  gap: 24px;
}

.invoice-top {
  align-items: start;
  border-bottom: 0;
  padding-top: 26px;
  padding-bottom: 18px;
}

.invoice-top h2 {
  margin: 0 0 8px;
  color: #2f241a;
  font-size: 28px;
  letter-spacing: 0;
}

.invoice-top p,
.invoice-parties p,
.invoice-bottom p {
  margin: 5px 0;
  color: #6f6256;
}

.seller-info {
  display: grid;
  gap: 2px;
  max-width: 720px;
}

.seller-info p {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  margin: 2px 0;
  font-size: 11.5px;
}

.seller-info span {
  color: var(--muted);
}

.seller-info strong {
  color: #4a3a2a;
  font-weight: 600;
  line-height: 1.32;
}

.invoice-meta {
  justify-self: end;
  min-width: 236px;
  border: 1px solid #eadccb;
  border-radius: 14px;
  background: #fffaf4;
  padding: 12px 14px;
}

.invoice-meta p {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #efe4d7;
  padding-bottom: 6px;
  font-size: 12px;
}

.invoice-meta p:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.invoice-parties {
  margin: 12px 0 14px;
  border: 1px solid #eadccb;
  border-radius: 14px;
  background: #fffaf5;
  padding: 14px 16px;
}

.invoice-parties strong,
.invoice-bottom strong {
  color: #6b553f;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.invoice-table th,
.invoice-table td {
  padding: 8px 7px;
}

.invoice-table {
  width: calc(100% - 68px);
  margin: 0 34px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid #eadccb;
  border-radius: 14px;
}

.quotation-table th,
.quotation-table td {
  font-size: 10.5px;
  line-height: 1.28;
}

.quotation-table th:first-child,
.quotation-table td:first-child {
  width: 48px;
  text-align: center;
}

.quotation-table .product-thumb,
.quotation-table .product-image {
  width: 42px;
  height: 42px;
  border-radius: 6px;
}

.invoice-table th {
  background: #f8efe2;
  color: #6b553f;
  font-weight: 800;
}

.invoice-table td {
  border-bottom: 1px solid #f0e5d9;
}

.invoice-table tbody tr:nth-child(even) td {
  background: #fffaf5;
}

.invoice-table tbody tr:last-child td {
  border-bottom: 0;
}

.invoice-table td:nth-child(5),
.invoice-table td:nth-child(6),
.invoice-table td:nth-child(7),
.invoice-table th:nth-child(5),
.invoice-table th:nth-child(6),
.invoice-table th:nth-child(7) {
  text-align: right;
}

.invoice-bottom {
  margin-top: 14px;
  padding-bottom: 22px;
  align-items: start;
}

.invoice-totals {
  display: grid;
  gap: 5px;
  border: 1px solid #eadccb;
  border-radius: 14px;
  background: #fffdf9;
  padding: 12px 14px;
}

.invoice-totals .grand {
  border-top: 2px solid #d8bf9e;
  margin-top: 2px;
  padding-top: 8px;
}

.invoice-totals .grand strong {
  color: #8a6844;
  font-size: 18px;
}

.quotation-document .invoice-bottom p,
.quotation-document .invoice-parties p {
  font-size: 11px;
  line-height: 1.35;
}

.quotation-document .payment-breakdown {
  font-size: 10.5px;
  line-height: 1.3;
}

.signature-row {
  margin-top: 60px;
}

.signature-row span {
  display: block;
  border-top: 1px solid var(--ink);
  padding-top: 8px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .product-change-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .app-shell,
  .quote-grid,
  .form-page-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 18px;
  }

  .nav-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    flex: initial;
    min-height: auto;
    overflow: visible;
  }

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

  .nav-child {
    margin-left: 0;
    width: 100%;
    padding-left: 14px;
  }

  .nav-child::before {
    display: none;
  }

  .workspace {
    overflow: visible;
    padding: 18px;
  }

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

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

  .home-exchange-row {
    grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(92px, 1fr));
    gap: 12px;
  }

  .home-drafts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-topbar-actions,
  .home-continue-side {
    width: 100%;
  }

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

  .home-continue-side {
    justify-content: flex-start;
  }

  .quote-form .form-grid.compact,
  .quote-form .quote-main-grid,
  .quote-form .form-grid.thirds,
  .quote-editor-stack .quote-form .form-grid:not(.single),
  .quote-cost-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-detail-layout,
  .detail-grid,
  .product-editor-grid-top,
  .product-editor-grid-middle,
  .product-editor-grid-bottom {
    grid-template-columns: 1fr;
  }

  .product-list-detail-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .product-list-detail-summary {
    grid-template-columns: 1fr;
  }

  .product-list-meta-block {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

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

  .desktop-update-hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .detail-title-row {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .workspace-header,
  .table-toolbar,
  .header-actions,
  .subview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .table-toolbar input,
  .table-toolbar select {
    max-width: none;
  }

  .home-exchange-head,
  .home-exchange-meta,
  .home-exchange-error {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-exchange-head .home-soft-button,
  .home-exchange-error .home-soft-button {
    width: 100%;
  }

  .home-exchange-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }

  .home-exchange-currency {
    grid-column: 1 / -1;
  }

  .home-exchange-loading {
    grid-template-columns: 1fr;
  }

  .subview-toolbar .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .security-ip-form {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .product-editor-grid-top,
  .product-editor-grid-middle,
  .product-editor-grid-bottom,
  .quote-form .form-grid.compact,
  .quote-form .quote-main-grid,
  .quote-form .form-grid.thirds,
  .quote-cost-grid,
  .quote-editor-stack .quote-form .form-grid:not(.single),
  .invoice-top,
  .invoice-parties,
  .invoice-bottom,
  .signature-row {
    grid-template-columns: 1fr;
  }

  .workspace-header h2 {
    font-size: 25px;
  }

  .invoice-document {
    padding: 20px;
  }

  .quotation-document {
    padding: 0;
  }

  .quotation-document > .invoice-top,
  .quotation-document > .invoice-parties,
  .quotation-document > .invoice-bottom {
    margin-left: 18px;
    margin-right: 18px;
  }

  .quotation-document .invoice-table {
    display: block;
    width: calc(100% - 36px);
    margin-left: 18px;
    margin-right: 18px;
    overflow-x: auto;
  }

  .invoice-meta {
    justify-self: stretch;
  }

  .desktop-update-summary {
    grid-template-columns: 1fr;
  }

  .desktop-update-hero h4 {
    font-size: 22px;
  }
}

@media print {
  .quotation-document.invoice-document {
    max-width: none;
    width: 210mm;
    min-height: auto;
    padding: 0;
    box-shadow: none;
  }

  .quotation-document > .invoice-top,
  .quotation-document > .invoice-parties,
  .quotation-document > .invoice-bottom {
    margin-left: 8mm;
    margin-right: 8mm;
  }

  .quotation-document .invoice-table {
    width: calc(100% - 16mm);
    margin-left: 8mm;
    margin-right: 8mm;
  }

  .quotation-document .invoice-top {
    padding-top: 7mm;
    padding-bottom: 4mm;
  }

  .quotation-document .invoice-parties {
    margin-top: 3mm;
    margin-bottom: 4mm;
  }

  .quotation-document .invoice-bottom {
    margin-top: 4mm;
    padding-bottom: 6mm;
  }
}

@page {
  margin: 0;
  size: A4;
}

@media print {
  html,
  body {
    background: #ffffff;
    margin: 0;
  }

  .sidebar,
  .no-print,
  .view:not(.active) {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .view.active {
    display: block;
    padding: 0;
  }

  .invoice-document {
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    padding: 12mm;
  }
}

#product-list-view .table-wrap select,
#product-list-view .table-wrap input[type="text"],
#product-list-view .table-wrap input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d6e2ec;
  border-radius: 10px;
  background: #ffffff;
  font: inherit;
}

#product-list-view .table-wrap small {
  color: var(--muted);
}
