:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-secondary: #eef3f8;
  --primary: #1769e0;
  --primary-dark: #0f4db0;
  --accent: #0f9f8f;
  --text: #172033;
  --muted: #657285;
  --border: #d8e0ea;
  --danger: #c62828;
  --radius: 8px;
  --shadow: 0 14px 34px rgba(28, 41, 61, 0.08);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft Yahei", system-ui, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #edf3fa 0, #f7f9fc 280px, #f3f6fa 100%);
  letter-spacing: 0;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  align-items: center;
  justify-content: stretch;
  padding: clamp(18px, 4vw, 54px);
  background:
    linear-gradient(90deg, rgba(12, 20, 35, 0.9), rgba(22, 40, 70, 0.7)),
    url("../images/home-dashboard.png") center / cover;
}

.auth-page::before {
  content: "YIG Production Management";
  display: flex;
  align-items: flex-end;
  align-self: stretch;
  min-height: 520px;
  padding: clamp(28px, 5vw, 72px);
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 900;
  line-height: 1.05;
}

.auth-card {
  width: min(520px, 100%);
  justify-self: end;
  background: rgba(255, 255, 255, 0.96);
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  box-shadow: 0 28px 70px rgba(8, 17, 32, 0.28);
  backdrop-filter: blur(16px);
}

.auth-card h1 {
  margin: 0 0 8px;
  text-align: left;
  font-size: 28px;
  line-height: 1.2;
}

.auth-card h2 {
  margin: 0 0 24px;
  text-align: left;
  font-size: 18px;
  color: var(--muted);
}

.auth-form {
  gap: 16px;
}

.auth-form .field {
  width: 100%;
}

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

.auth-code-row .btn {
  white-space: nowrap;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.auth-actions .btn {
  width: 100%;
}

.auth-helper {
  margin-top: 16px;
  text-align: left;
  color: var(--muted);
}

.auth-helper a {
  color: var(--primary);
}

.home-page {
  min-height: 100vh;
  background: #f6f8fb;
  color: #172033;
}

.home-page a {
  color: inherit;
}

.home-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 64px);
  color: #fff;
  background: rgba(15, 23, 42, 0.66);
  border-bottom: 1px solid rgba(226, 232, 240, 0.2);
  backdrop-filter: blur(12px);
}

.home-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}

.home-brand strong {
  font-size: 27px;
  line-height: 1;
  letter-spacing: 0;
}

.home-brand span {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.home-actions,
.home-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  min-width: 104px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.home-button:hover {
  transform: translateY(-1px);
}

.home-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.home-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.home-button--nav {
  min-width: 74px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.home-button--primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.home-button--primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.home-button--ghost {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.home-button--ghost:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.16);
}

.home-button--secondary {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
}

.home-button--secondary:hover {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(15, 23, 42, 0.62);
}

.home-hero {
  position: relative;
  min-height: min(82vh, 780px);
  display: flex;
  align-items: center;
  padding: 118px clamp(18px, 5vw, 84px) 64px;
  color: #fff;
  background-image: url("../images/home-dashboard.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.home-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 17, 32, 0.92) 0%, rgba(10, 17, 32, 0.78) 42%, rgba(10, 17, 32, 0.28) 100%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.04) 42%);
}

.home-hero__content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  min-height: 310px;
}

.home-kicker,
.home-section__eyebrow,
.home-section__head p {
  margin: 0 0 12px;
  color: #2dd4bf;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: 0;
}

.home-lead {
  width: min(650px, 100%);
  margin: 22px 0 28px;
  color: rgba(241, 245, 249, 0.88);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.8;
}

.home-hero-slide {
  position: absolute;
  inset: 0 auto auto 0;
  width: min(720px, 100%);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.home-hero-slide.is-active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.home-carousel-dots {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.home-carousel-dots button {
  width: 34px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  cursor: pointer;
}

.home-carousel-dots button.is-active {
  background: #2dd4bf;
}

.home-section {
  padding: 58px clamp(18px, 5vw, 84px);
}

.home-section--intro {
  background: #fff;
}

.home-section__head {
  max-width: 760px;
  margin-bottom: 24px;
}

.home-section h2,
.home-bottom h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(26px, 3.5vw, 42px);
  line-height: 1.18;
  letter-spacing: 0;
}

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

.home-feature {
  min-height: 220px;
  padding: 24px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
}

.home-feature span {
  display: block;
  margin-bottom: 34px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
}

.home-feature h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 22px;
}

.home-feature p,
.home-workflow p,
.home-bottom p {
  margin: 0;
  color: #5d6677;
  line-height: 1.75;
}

.home-system-grid .home-feature {
  display: flex;
  flex-direction: column;
}

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

.home-system-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  margin-top: auto;
  padding: 0 14px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
}

.home-system-link:hover {
  background: #2563eb;
}

.home-workflow {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 42px;
  align-items: start;
  background: #edf2f7;
}

.home-workflow > div {
  max-width: 650px;
}

.home-workflow p {
  margin-top: 18px;
  font-size: 17px;
}

.home-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-steps li {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid #d6dee9;
  border-radius: 8px;
  background: #fff;
}

.home-steps strong {
  color: #111827;
  font-size: 18px;
}

.home-steps span {
  color: #5d6677;
  line-height: 1.6;
}

.home-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 42px clamp(18px, 5vw, 84px) 52px;
  background: #111827;
  color: #fff;
}

.home-bottom h2 {
  color: #fff;
}

.home-bottom p {
  margin-top: 10px;
  color: rgba(241, 245, 249, 0.78);
}

.auth-reset {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.auth-reset summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  text-align: center;
}

.auth-reset .auth-form {
  margin-top: 16px;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.page__header {
  padding: 22px clamp(20px, 3vw, 52px) 14px;
  background:
    linear-gradient(135deg, #172033 0%, #203552 62%, #0f766e 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(23, 32, 51, 0.16);
}

.page__header--compact {
  padding-top: 12px;
  padding-bottom: 4px;
}

.page__header--compact .page__header-top {
  margin-bottom: 4px;
}

.page__header--compact h1 {
  font-size: clamp(20px, 2.2vw, 26px);
  min-height: 34px;
}

.page__header--icon-nav {
  padding-top: 6px;
}

.page__header--icon-nav .page__header-top {
  display: block;
  margin-bottom: 0;
}

.page__header--icon-nav .page__nav-shell {
  min-height: 0;
}

.page__header--icon-nav .page__nav-toggle {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 7px;
}

.page__header--icon-nav .page__nav-toggle span,
.page__header--icon-nav .page__nav-toggle strong {
  display: none;
}

.page__header--icon-nav .page__nav-toggle::before {
  font-size: 15px;
}

.page__header-top {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 14px 18px;
  margin-bottom: 14px;
}

.page__user {
  margin-left: 0;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.page__user .page__nav-link {
  padding: 7px 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.page__nav-shell {
  position: relative;
  flex: 0 0 auto;
  min-height: 38px;
  z-index: 20;
}

.page__nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  box-shadow: none;
  user-select: none;
}

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

.page__nav-toggle::before {
  content: "☰";
  color: #5eead4;
  font-size: 14px;
  line-height: 1;
}

.page__nav-toggle span {
  color: rgba(255, 255, 255, 0.72);
}

.page__nav-shell[open] .page__nav-toggle {
  border-color: rgba(94, 234, 212, 0.55);
  color: #fff;
}

.page__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 5px;
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.page__nav--dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 5px;
  flex: none;
  width: max-content;
  min-width: 260px;
  max-width: min(520px, calc(100vw - 48px));
  background: #fff;
  border: 1px solid rgba(216, 220, 227, 0.95);
  padding: 8px;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(39, 56, 84, 0.16);
}

.page__nav--dropdown .page__nav-link {
  color: #344256;
}

.page__nav--dropdown .page__nav-link:hover {
  background: #edf4fb;
  color: var(--primary);
}

.page__nav--dropdown .page__nav-link.is-active {
  background: var(--primary);
  color: #fff;
}

.page__nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.page__nav-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.page__nav-link.is-active {
  background: #fff;
  color: #172033;
  box-shadow: 0 10px 22px rgba(7, 12, 24, 0.14);
}

.page__header h1 {
  margin: 0;
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 850;
  letter-spacing: 0;
}

.page__header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
}

.page__main {
  padding: 24px clamp(20px, 3vw, 52px) 52px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page__main--flush {
  padding-top: 12px;
}

.page__main--tight {
  padding-top: 4px;
}

.kanban-page .page {
  display: block;
}

.kanban-page .page__main--tight {
  padding-top: 8px;
  padding-bottom: 64px;
}

.kanban-bottom-nav {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 90;
}

.kanban-bottom-nav .page__nav-shell {
  min-height: 0;
}

.kanban-bottom-nav .page__nav-toggle {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 9px;
}

.kanban-bottom-nav .page__nav-toggle span,
.kanban-bottom-nav .page__nav-toggle strong {
  display: none;
}

.kanban-bottom-nav .page__nav--dropdown {
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
  left: auto;
}

.supplies-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.bom-summary {
  margin-bottom: 24px;
}

.bom-summary h3 {
  margin-bottom: 12px;
}

.bom-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.plan-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.plan-summary .summary-breakdown > strong {
  display: block;
  margin-bottom: 8px;
}

.plan-summary .summary-products > strong {
  display: block;
  margin-bottom: 4px;
}

.plan-summary .product-summary-list {
  list-style: disc;
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 4px;
}

.order-breakdown-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.order-breakdown-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.45;
}

.order-breakdown-table th,
.order-breakdown-table td {
  border: 1px solid #d8dee8;
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.order-breakdown-table th {
  background: #f5f7fb;
  color: #374151;
  font-weight: 600;
}

.order-breakdown-table td:first-child {
  min-width: 180px;
  white-space: normal;
}

.plan-detail-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-plan-modal__body {
  width: min(1280px, 100%);
  height: min(92vh, 900px);
  padding: 0;
  overflow: hidden;
}

.schedule-plan-modal__body .modal__header {
  display: flex;
  padding: 18px 22px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.schedule-plan-modal__body .bom-modal-content {
  height: calc(100% - 65px);
}

.schedule-plan-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--background);
}

body[data-embedded-plan="1"] {
  background: transparent;
  overflow: hidden;
}

body[data-embedded-plan="1"] > .page {
  display: none;
}

body[data-embedded-plan="1"] .modal {
  position: fixed;
  inset: 0;
  padding: 0;
}

body[data-embedded-plan="1"] .modal__overlay {
  display: none;
}

body[data-embedded-plan="1"] .modal__body {
  width: 100%;
  max-height: none;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
}

.plan-edit-panel form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-edit-meta {
  align-items: end;
}

.plan-edit-table th:first-child,
.plan-edit-table td:first-child {
  width: 56px;
  text-align: center;
}

.plan-edit-table th:last-child,
.plan-edit-table td:last-child {
  width: 88px;
  text-align: center;
}

.plan-edit-table input {
  min-width: 110px;
}

.plan-edit-actions {
  margin-top: 4px;
}

.erp-page {
  gap: 18px;
}

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

.erp-metric {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

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

.erp-metric strong {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.15;
}

.erp-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.bom-section {
  margin-bottom: 24px;
}

.bom-section h4 {
  margin-bottom: 12px;
}

.supply-name-input {
  display: flex;
  flex-direction: column;
}

.settings-main {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.settings-alert {
  grid-column: 1 / -1;
}

.settings-card {
  grid-column: span 6;
  min-height: 100%;
  padding: 0;
  overflow: hidden;
}

.settings-card--wide {
  grid-column: 1 / -1;
}

.settings-card > .card__header {
  margin: 0;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.settings-card > .card__header h2 {
  font-size: 20px;
}

.settings-card > .card__header .helper {
  margin: 6px 0 0;
}

.settings-card > :not(.card__header) {
  margin-left: 22px;
  margin-right: 22px;
}

.settings-card > :last-child {
  margin-bottom: 22px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  margin-bottom: 18px;
}

.settings-stack-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 20px;
}

.settings-stack-form .field:last-child {
  margin-top: 4px;
}

.settings-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-card .table-wrapper,
.settings-card .schedule-table-wrap {
  margin-top: 14px;
}

.settings-card .data-table th,
.settings-card .data-table td,
.settings-card .schedule-table th,
.settings-card .schedule-table td {
  padding: 12px 13px;
}

.settings-card .button-row,
.settings-card .schedule-actions {
  gap: 8px;
  justify-content: flex-start;
}

.settings-card .flash {
  margin-top: 18px;
  margin-bottom: 16px;
}

.settings-main--redesigned {
  display: block;
  width: min(1320px, 100%);
}

.settings-main--redesigned .settings-alert {
  margin-bottom: 16px;
}

.settings-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-sidebar {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.settings-profile {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.settings-profile__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.settings-profile strong,
.settings-profile span {
  display: block;
}

.settings-profile strong {
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
}

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

.settings-meta {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.settings-meta div {
  min-width: 0;
}

.settings-meta dt {
  margin-bottom: 4px;
  color: #718096;
  font-size: 12px;
  font-weight: 800;
}

.settings-meta dd {
  margin: 0;
  color: #172033;
  font-size: 14px;
  word-break: break-word;
}

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

.settings-side-nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: #405067;
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.settings-side-nav a:hover {
  background: #edf4fb;
  color: var(--primary);
}

.settings-content {
  display: grid;
  gap: 18px;
}

.settings-panel {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.settings-panel__head span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.settings-panel__head h2 {
  margin: 0;
  color: #111827;
  font-size: 21px;
  line-height: 1.2;
}

.settings-panel > :not(.settings-panel__head) {
  margin-left: 22px;
  margin-right: 22px;
}

.settings-panel > :last-child {
  margin-bottom: 22px;
}

.settings-panel .settings-form-grid,
.settings-panel .settings-stack-form,
.settings-panel .settings-inline-form {
  margin-top: 18px;
}

.settings-field-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-field-card label,
.settings-field-card span {
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.settings-field-card .btn {
  align-self: flex-start;
}

.settings-table th:last-child,
.settings-table td:last-child {
  width: 180px;
}

.settings-center {
  width: min(1320px, 100%);
  margin: 0 auto;
  gap: 18px;
}

.settings-overview {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(216, 224, 234, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f8fafc 58%, #eef7f5 100%);
  box-shadow: var(--shadow);
}

.settings-overview__title {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.settings-overview__title span,
.settings-center-card__head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.settings-overview__title h2 {
  margin: 6px 0 0;
  color: #111827;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.1;
}

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

.settings-mini-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.settings-mini-card span,
.settings-mini-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.settings-mini-card strong {
  display: block;
  margin: 9px 0 5px;
  color: #172033;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.settings-center-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(28, 41, 61, 0.05);
}

.settings-center-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #405067;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.settings-center-nav button:hover {
  background: #edf4fb;
  color: var(--primary);
}

.settings-center-nav button.is-active {
  background: var(--primary);
  color: #fff;
}

.settings-center-grid {
  display: block;
}

.settings-center-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings-center-card[data-settings-panel] {
  display: none;
}

.settings-center-card[data-settings-panel].is-active {
  display: block;
}

.settings-center-card--wide {
  grid-column: 1 / -1;
}

.settings-center-card__head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.settings-center-card__head h3 {
  margin: 5px 0 0;
  color: #111827;
  font-size: 21px;
  line-height: 1.2;
}

.settings-center-card > :not(.settings-center-card__head) {
  margin-left: 20px;
  margin-right: 20px;
}

.settings-center-card > :last-child {
  margin-bottom: 20px;
}

.settings-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.settings-control {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-control label,
.settings-control span {
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.settings-control__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.settings-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-add-row--wide {
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-stack-form--clean {
  margin-top: 18px;
  margin-bottom: 20px;
}

.settings-stack-form--clean .btn--primary {
  width: fit-content;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.settings-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

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

.settings-list-row strong {
  color: #172033;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.settings-list-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.settings-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.settings-empty {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #f8fafc;
}

.platform-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: #f3f6fb;
}

.platform-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  background: #101827;
  color: #fff;
}

.platform-brand {
  display: grid;
  gap: 6px;
  padding: 4px 6px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.platform-brand strong {
  font-size: 20px;
}

.platform-brand span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.66);
}

.platform-side-nav {
  display: grid;
  gap: 8px;
}

.platform-side-nav button,
.platform-logout {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  cursor: pointer;
}

.platform-side-nav button:hover,
.platform-side-nav button.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.platform-logout {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.platform-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
}

.platform-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.platform-topbar h1 {
  margin: 0;
  font-size: 28px;
}

.platform-topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.platform-topbar__links,
.platform-admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.platform-admin-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--primary);
  background: #fff;
  text-decoration: none;
}

.platform-create-user-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.platform-create-user-form input,
.platform-create-user-form select,
.platform-profile-form input,
.platform-password-form input {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}

.platform-profile-form,
.platform-password-form {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.platform-panel {
  display: none;
}

.platform-panel.is-active {
  display: grid;
  gap: 18px;
}

.platform-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.platform-module-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

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

.platform-module-card strong {
  font-size: 24px;
}

.platform-module-card p {
  margin: 0;
  color: var(--muted);
}

.platform-subscription-form {
  display: grid;
  grid-template-columns: minmax(96px, 120px) minmax(120px, 150px) auto;
  gap: 8px;
  align-items: center;
  min-width: 340px;
}

.platform-subscription-form select,
.platform-subscription-form input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.platform-systems-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(116px, 150px);
  gap: 6px 8px;
  align-items: center;
  min-width: 330px;
}

.platform-limit-note {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.platform-systems-form select {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.platform-systems-form .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .platform-shell {
    grid-template-columns: 1fr;
  }

  .platform-sidebar {
    position: static;
    height: auto;
  }

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

  .platform-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-main {
    padding: 16px;
  }

  .platform-create-user-form {
    grid-template-columns: 1fr;
  }
}

.production-inbound {
  display: grid;
  gap: 18px;
}

.inbound-scan-card .plan-form {
  align-items: end;
}

.inbound-scan-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inbound-scan-input-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.inbound-photo-scan input {
  display: none;
}

.inbound-entry-table input {
  min-width: 92px;
}

.inbound-summary-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.inbound-summary-bar > div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.inbound-summary-bar span,
.inbound-line-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inbound-summary-bar strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.inbound-lines {
  display: grid;
  gap: 12px;
}

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

.inbound-line-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.inbound-line-card header strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.inbound-line-card header span {
  flex: 0 1 58%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
}

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

.inbound-line-grid .field {
  min-width: 0;
}

.inbound-line-grid input,
.inbound-line-grid textarea,
.inbound-line-grid select {
  width: 100%;
  min-width: 0;
}

.inbound-rfid-field {
  grid-column: 1 / -1;
}

.inbound-rfid-field textarea,
#general-supply-order-inbound-form textarea[name="rfidTags"] {
  min-height: 72px;
  resize: vertical;
}

.inbound-line-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.inbound-line-metrics > div {
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.inbound-line-metrics strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.inbound-line-metrics b {
  font: inherit;
}

.inbound-submit-actions {
  margin-top: 12px;
}

.inbound-submit-actions .btn {
  width: 100%;
}

.inbound-print-option {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.inbound-print-option input {
  width: 18px;
  height: 18px;
}

.inbound-record-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.inbound-record-actions h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.inbound-record-actions .btn {
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
}

.inbound-history-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.inbound-history-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.production-inbound-records .card__header {
  align-items: center;
}

.inbound-record-filter-actions > div {
  display: flex;
  gap: 8px;
}

.inbound-records-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.inbound-records-summary > div {
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.inbound-records-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inbound-records-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.inbound-records-table th,
.inbound-records-table td {
  padding: 9px 8px;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: top;
}

.inbound-records-table {
  table-layout: fixed;
  min-width: 0;
}

.inbound-records-table th {
  white-space: nowrap;
}

.inbound-records-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.inbound-records-table th:nth-child(1),
.inbound-records-table td:nth-child(1) {
  width: 42px;
  text-align: center;
}

.inbound-records-table th:nth-child(2),
.inbound-records-table td:nth-child(2) {
  width: 78px;
}

.inbound-records-table th:nth-child(3),
.inbound-records-table td:nth-child(3) {
  width: 118px;
}

.inbound-records-table th:nth-child(4),
.inbound-records-table td:nth-child(4),
.inbound-records-table th:nth-child(5),
.inbound-records-table td:nth-child(5) {
  width: 76px;
}

.inbound-records-table th:nth-child(6),
.inbound-records-table td:nth-child(6) {
  width: 160px;
}

.inbound-records-table th:nth-child(7),
.inbound-records-table td:nth-child(7) {
  width: 72px;
}

.inbound-records-table th:nth-child(8),
.inbound-records-table td:nth-child(8) {
  width: 160px;
}

.inbound-records-table th:nth-child(9),
.inbound-records-table td:nth-child(9) {
  width: 64px;
}

.inbound-records-table th:nth-child(10),
.inbound-records-table td:nth-child(10),
.inbound-records-table th:nth-child(11),
.inbound-records-table td:nth-child(11) {
  width: 92px;
}

.inbound-records-table th:nth-child(12),
.inbound-records-table td:nth-child(12) {
  width: 126px;
}

.inbound-records-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.inbound-record-cell-stack {
  display: grid;
  gap: 3px;
}

.inbound-record-cell-stack strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}

.inbound-record-cell-stack span {
  color: var(--muted);
  font-size: 11px;
}

.inbound-record-cell-stack--numeric strong {
  font-size: 13px;
}

.inbound-record-weight-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 7px;
  font-size: 11px;
  line-height: 1.3;
}

.inbound-record-weight-stack span {
  white-space: nowrap;
}

.inbound-record-weight-stack b {
  display: inline-block;
  min-width: 16px;
  margin-right: 3px;
  color: var(--muted);
}

.inbound-record-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: flex-start;
}

.inbound-record-table-actions .btn {
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.2;
}

.inbound-records-mobile-list {
  display: none;
}

.inbound-record-mobile-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.inbound-record-mobile-card header,
.inbound-record-mobile-card footer,
.inbound-record-mobile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inbound-record-mobile-card header label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
}

.inbound-record-mobile-card header span,
.inbound-record-mobile-title strong {
  overflow-wrap: anywhere;
}

.inbound-record-mobile-card header strong,
.inbound-record-mobile-title span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.inbound-record-mobile-title {
  align-items: flex-start;
  margin-top: 10px;
}

.inbound-record-mobile-title strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.inbound-record-mobile-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.inbound-record-mobile-card dl > div {
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: #f8fafc;
}

.inbound-record-mobile-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inbound-record-mobile-card dd {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.inbound-record-mobile-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inbound-record-mobile-card footer {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

.inbound-record-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.inbound-record-dialog::backdrop {
  background: rgba(15, 23, 42, 0.36);
}

.inbound-record-dialog__body {
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 18px;
  background: #fff;
}

.inbound-record-dialog__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.inbound-record-dialog__header h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
}

.inbound-record-dialog__header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.inbound-plan-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.inbound-plan-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.inbound-plan-modal.is-open {
  display: block;
}

.inbound-plan-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.inbound-plan-modal__body {
  position: absolute;
  inset: 24px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
}

.inbound-plan-modal__body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.inbound-plan-modal__body h3 {
  margin: 0;
  color: var(--text);
}

.inbound-plan-modal__content {
  min-height: 0;
}

.inbound-plan-modal__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.inbound-record-detail-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.inbound-record-detail-metrics > div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.inbound-record-detail-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inbound-record-detail-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inbound-record-detail-table input {
  width: 96px;
  min-width: 0;
}

.inbound-record-note {
  margin-top: 12px;
}

.inbound-record-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.inbound-record-materials {
  margin-top: 18px;
}

.inbound-record-materials h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 17px;
}

.btn--danger {
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
  background: #fff;
}

.btn--danger:hover {
  border-color: rgba(220, 38, 38, 0.55);
  background: #fef2f2;
}

.btn--small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.inbound-camera-card {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.62);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.inbound-camera-card[hidden] {
  display: none;
}

.inbound-camera-card > .card__header,
.inbound-camera-card > .inbound-camera-box,
.inbound-camera-card > .helper {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
}

.inbound-camera-card > .card__header {
  align-items: flex-start;
  margin-bottom: 0;
  padding: 14px 16px 10px;
  border-radius: 10px 10px 0 0;
  background: #fff;
}

.inbound-camera-card > .helper {
  margin: 0;
  padding: 10px 16px 14px;
  border-radius: 0 0 10px 10px;
  background: #fff;
}

.inbound-camera-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #0f172a;
  min-height: 390px;
  aspect-ratio: 1 / 1;
}

.inbound-camera-box video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#inbound-html5-reader {
  width: 100%;
  height: 100%;
  color: #f8fafc;
}

#inbound-html5-reader video,
#inbound-html5-reader canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

#inbound-html5-reader__scan_region,
#inbound-html5-reader__dashboard {
  border: 0 !important;
}

#inbound-html5-reader__dashboard {
  display: none;
}

.inbound-camera-frame {
  position: absolute;
  inset: 9%;
  border: 3px solid rgba(45, 212, 191, 0.95);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.16);
  pointer-events: none;
}

#inbound-camera-message.is-error {
  color: var(--danger);
}

.inbound-tag-scan-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.inbound-tag-scan-modal[hidden] {
  display: none;
}

.inbound-tag-scan-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
}

.inbound-tag-scan-modal__body {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 10px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.inbound-tag-scan-modal__body header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inbound-tag-scan-modal__body h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.inbound-tag-scan-modal__body header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inbound-tag-camera-box {
  min-height: 360px;
}

#inbound-tag-html5-reader {
  width: 100%;
  height: 100%;
  color: #f8fafc;
}

#inbound-tag-html5-reader video,
#inbound-tag-html5-reader canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

#inbound-tag-html5-reader__scan_region,
#inbound-tag-html5-reader__dashboard {
  border: 0 !important;
}

#inbound-tag-html5-reader__dashboard {
  display: none;
}

#inbound-tag-camera-message.is-error {
  color: var(--danger);
}

.inbound-rfid-bind {
  display: grid;
  gap: 8px;
}

.inbound-rfid-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}

.inbound-rfid-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 13px;
  font-weight: 850;
}

.inbound-rfid-chip button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(6, 95, 70, 0.12);
  color: #065f46;
  cursor: pointer;
  line-height: 1;
}

.inbound-match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.inbound-match-grid > div {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.inbound-match-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inbound-match-grid strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inbound-submit-form {
  margin-top: 4px;
}

.inbound-records {
  margin-top: 14px;
}

@media (max-width: 720px) {
  .production-inbound {
    gap: 12px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .production-inbound .card {
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.06);
  }

  .inbound-scan-card {
    margin-top: 8px;
  }

  .inbound-scan-card .card__header {
    margin-bottom: 10px;
  }

  .inbound-scan-card .card__header h2 {
    font-size: 20px;
  }

  .inbound-scan-card .plan-form {
    display: block;
  }

  .inbound-scan-card .field > span {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .inbound-scan-card .helper {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
  }

  .inbound-scan-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .inbound-scan-input-row input {
    grid-column: 1 / -1;
    min-height: 42px;
    font-size: 16px;
    border-color: #cbd5e1;
    background: #f8fafc;
  }

  .inbound-scan-input-row .btn,
  .inbound-photo-scan {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    font-size: 15px;
    font-weight: 850;
  }

  #inbound-camera-button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
  }

  .inbound-scan-card .field:last-child {
    margin-top: 10px;
  }

  .inbound-scan-card .field:last-child > span {
    display: none;
  }

  .inbound-scan-card .field:last-child .btn {
    width: 100%;
    min-height: 42px;
  }

  .inbound-summary-bar,
  .inbound-line-grid {
    grid-template-columns: 1fr;
  }

  .inbound-summary-bar {
    gap: 8px;
    margin-bottom: 10px;
  }

  .inbound-summary-bar > div {
    padding: 10px 12px;
  }

  .inbound-summary-bar strong {
    font-size: 17px;
  }

  .inbound-line-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .inbound-line-card header {
    display: block;
  }

  .inbound-line-card header span {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  .inbound-line-card {
    padding: 10px;
    background: #fbfdff;
  }

  .inbound-line-card header strong {
    font-size: 17px;
  }

  .inbound-line-metrics > div {
    padding: 8px;
  }

  .inbound-line-metrics strong {
    font-size: 13px;
  }

  .inbound-line-grid input,
  .inbound-line-grid select,
  .inbound-line-grid textarea,
  #general-supply-order-inbound-form input {
    min-height: 42px;
    font-size: 16px;
  }

  .inbound-rfid-bind .btn {
    width: 100%;
    justify-content: center;
  }

  .inbound-print-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
  }

  .inbound-submit-actions .btn {
    min-height: 46px;
    font-size: 16px;
  }

  .inbound-history-card .card__header {
    align-items: center;
  }

  .inbound-history-card .table-wrapper,
  #general-supply-order-inbound-form .table-wrapper {
    overflow: visible;
  }

  .inbound-history-card table,
  #general-supply-order-inbound-form table {
    min-width: 0;
  }

  .inbound-history-card table,
  .inbound-history-card thead,
  .inbound-history-card tbody,
  .inbound-history-card tr,
  .inbound-history-card td,
  #general-supply-order-inbound-form table,
  #general-supply-order-inbound-form thead,
  #general-supply-order-inbound-form tbody,
  #general-supply-order-inbound-form tr,
  #general-supply-order-inbound-form td {
    display: block;
    width: 100%;
  }

  .inbound-history-card thead,
  #general-supply-order-inbound-form thead {
    display: none;
  }

  .inbound-history-card tbody,
  #general-supply-order-inbound-form tbody {
    display: grid;
    gap: 10px;
  }

  .inbound-history-card tbody tr,
  #general-supply-order-inbound-form tbody tr {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
  }

  .inbound-history-card .data-table td,
  #general-supply-order-inbound-form .data-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 34px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid #e5edf5;
    font-size: 14px;
    white-space: normal;
  }

  .inbound-history-card .data-table td:last-child,
  #general-supply-order-inbound-form .data-table td:last-child {
    border-bottom: 0;
  }

  .inbound-history-card .data-table td::before,
  #general-supply-order-inbound-form .data-table td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
  }

  .inbound-history-card .data-table td:nth-child(1)::before { content: "选择"; }
  .inbound-history-card .data-table td:nth-child(2)::before { content: "时间"; }
  .inbound-history-card .data-table td:nth-child(3)::before { content: "布产单"; }
  .inbound-history-card .data-table td:nth-child(4)::before { content: "模具"; }
  .inbound-history-card .data-table td:nth-child(5)::before { content: "产品编号"; }
  .inbound-history-card .data-table td:nth-child(6)::before { content: "色粉编号"; }
  .inbound-history-card .data-table td:nth-child(7)::before { content: "数量"; }
  .inbound-history-card .data-table td:nth-child(8)::before { content: "模数"; }
  .inbound-history-card .data-table td:nth-child(9)::before { content: "毛重"; }
  .inbound-history-card .data-table td:nth-child(10)::before { content: "扣重"; }
  .inbound-history-card .data-table td:nth-child(11)::before { content: "净重"; }
  .inbound-history-card .data-table td:nth-child(12)::before { content: "操作人"; }
  .inbound-history-card .data-table td:nth-child(13)::before { content: "备注"; }
  .inbound-history-card .data-table td:nth-child(14)::before { content: "打印"; }

  #general-supply-order-inbound-form .data-table td:nth-child(1)::before { content: "货号"; }
  #general-supply-order-inbound-form .data-table td:nth-child(2)::before { content: "物料"; }
  #general-supply-order-inbound-form .data-table td:nth-child(3)::before { content: "计划"; }
  #general-supply-order-inbound-form .data-table td:nth-child(4)::before { content: "已入库"; }
  #general-supply-order-inbound-form .data-table td:nth-child(5)::before { content: "未入库"; }
  #general-supply-order-inbound-form .data-table td:nth-child(6)::before { content: "本次"; }
  #general-supply-order-inbound-form .data-table td:nth-child(7)::before { content: "单位"; }
  #general-supply-order-inbound-form .data-table td:nth-child(8)::before { content: "标签"; }
  #general-supply-order-inbound-form .data-table td:nth-child(9)::before { content: "备注"; }

  .inbound-history-card .data-table td:nth-child(3),
  .inbound-history-card .data-table td:nth-child(5),
  #general-supply-order-inbound-form .data-table td:nth-child(2) {
    overflow-wrap: anywhere;
  }

  .inbound-history-card .data-table .btn,
  #general-supply-order-inbound-form .data-table .btn {
    width: 100%;
    justify-content: center;
  }

  .inbound-history-actions {
    justify-content: stretch;
  }

  .inbound-history-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .inbound-camera-card {
    padding: 10px;
    align-content: center;
  }

  .inbound-camera-card > .card__header,
  .inbound-camera-card > .inbound-camera-box,
  .inbound-camera-card > .helper {
    width: min(100%, 460px);
  }

  .inbound-camera-box {
    min-height: 0;
    height: min(72vh, calc(100vw - 20px));
    aspect-ratio: auto;
  }

  .inbound-tag-scan-modal {
    padding: 0;
  }

  .inbound-tag-scan-modal__body {
    width: 100vw;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .inbound-tag-camera-box {
    min-height: 0;
    height: min(70vh, calc(100vw - 32px));
  }

  .production-inbound-records .card__header {
    align-items: stretch;
    gap: 10px;
  }

  .production-inbound-records .card__header h2 {
    margin-bottom: 0;
  }

  .production-inbound-records .inbound-history-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .production-inbound-records .plan-form {
    grid-template-columns: 1fr;
  }

  .production-inbound-records .form-span-2 {
    grid-column: auto;
  }

  .inbound-record-filter-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .inbound-records-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .inbound-records-summary > div {
    min-height: 48px;
    padding: 7px 8px;
  }

  .inbound-records-summary strong {
    font-size: 13px;
  }

  .inbound-records-table {
    display: none;
  }

  .inbound-records-mobile-list {
    display: grid;
    gap: 10px;
  }

  .inbound-record-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .inbound-record-dialog__body {
    max-height: 100vh;
    padding: 12px;
  }

  .inbound-record-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .inbound-record-detail-metrics > div {
    min-height: 56px;
    padding: 8px;
  }

  .inbound-record-dialog__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .inbound-plan-modal__body {
    inset: 0;
    border-radius: 0;
  }
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(18px, 2.5vw, 28px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(216, 224, 234, 0.88);
}

.card--inner {
  background: #f8fafc;
  margin-top: 24px;
}

.modal__card {
  margin-top: 0;
}

.card--secondary {
  background: var(--surface-secondary);
  border: 1px dashed var(--border);
  box-shadow: none;
}

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

.card__header h2,
.card__header h3 {
  margin: 0;
  color: #111827;
  font-weight: 850;
  letter-spacing: 0;
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.prep-list-keyword {
  flex: 1 1 260px;
  max-width: 360px;
  min-width: 220px;
}

.category-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(57, 73, 171, 0.08);
}

.category-chip {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.category-chip:hover {
  background: rgba(57, 73, 171, 0.16);
}

.category-chip.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(57, 73, 171, 0.2);
}

.flash {
  border-radius: 8px;
  padding: 12px 14px;
  background: #e9f8f4;
  border: 1px solid #9bd8cc;
  color: #07594f;
  font-size: 14px;
  box-shadow: none;
}

.flash--error {
  background: #fff0f0;
  border-color: #ffc9c9;
  color: #9f1d1d;
  box-shadow: none;
}

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

.prep-basic-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.prep-type-field {
  display: none;
}

.prep-batch-panel {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.prep-batch-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.prep-batch-header h3 {
  margin: 0;
  font-size: 16px;
}

.prep-batch-header span {
  color: var(--muted);
  font-size: 13px;
}

.prep-batch-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.prep-batch-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.prep-batch-tools input[type="number"],
.prep-batch-tools input[type="text"] {
  width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
}

.prep-batch-table input[type="number"],
.prep-batch-table input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 13px;
}

.prep-batch-table {
  table-layout: fixed;
  min-width: 980px;
}

.prep-batch-table th,
.prep-batch-table td {
  vertical-align: middle;
}

.prep-batch-table th:nth-child(1),
.prep-batch-table td:nth-child(1) {
  width: 54px;
  text-align: center;
}

.prep-batch-table th:nth-child(2),
.prep-batch-table td:nth-child(2) {
  width: 86px;
  white-space: nowrap;
}

.prep-batch-table th:nth-child(3),
.prep-batch-table td:nth-child(3) {
  width: 220px;
}

.prep-batch-table th:nth-child(4),
.prep-batch-table td:nth-child(4) {
  width: 108px;
  white-space: nowrap;
}

.prep-batch-table th:nth-child(5),
.prep-batch-table td:nth-child(5) {
  width: 230px;
}

.prep-batch-table th:nth-child(6),
.prep-batch-table td:nth-child(6) {
  width: 150px;
}

.prep-batch-table th:nth-child(7),
.prep-batch-table td:nth-child(7) {
  width: 160px;
}

.prep-batch-cell--name,
.prep-batch-cell--calc {
  line-height: 1.45;
  word-break: break-word;
}

.prep-batch-check {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
}

.field-hint,
.prep-usage-cell {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.prep-usage-cell {
  min-width: 0;
  margin-top: 0;
}

td.prep-usage-cell {
  display: table-cell;
}

.single-prep-panel {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.single-prep-panel summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

.advanced-panel {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.advanced-panel summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

.advanced-panel .field + .field,
.advanced-panel .grid + .field {
  margin-top: 16px;
}

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

.production-method-switch__button {
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #162033;
  text-align: left;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.production-method-switch__button span {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.production-method-switch__button:hover,
.production-method-switch__button:focus-visible {
  border-color: rgba(23, 105, 224, 0.42);
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(23, 105, 224, 0.12);
  outline: none;
}

.production-method-switch__button.is-active {
  border-color: var(--primary);
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  color: var(--primary-dark);
  box-shadow: 0 12px 26px rgba(23, 105, 224, 0.16);
}

.production-method-card[hidden] {
  display: none;
}

.plan-form {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: end;
}

.form-span-full {
  grid-column: 1 / -1;
}

#plan-product-search {
  margin-bottom: 8px;
}

.plan-order-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 12px;
}

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

.single-mold-line {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr) auto;
}

.product-parts-order-line {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(57, 73, 171, 0.04);
}

.product-parts-order-fields {
  grid-template-columns: minmax(240px, 1.6fr) minmax(160px, 1fr) minmax(140px, 0.8fr) auto;
}

.product-parts-line-parts {
  margin-top: 12px;
}

.product-parts-lines .product-part-quantity {
  width: 120px;
}

.product-parts-lines td:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.plan-line-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-line-search {
  margin-bottom: 4px;
}

.plan-line-remove {
  white-space: nowrap;
}

.optional-col {
  display: none;
}

.show-optional .optional-col {
  display: table-cell;
}

.filter-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 16px;
  align-items: end;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.filter-actions .btn {
  flex: 1 1 auto;
}

.status-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.order-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-actions .btn {
  flex: 0 0 auto;
}

.order-action-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #bfdbca;
  border-radius: 8px;
  background: #eef8f1;
  color: #23613a;
  font-size: 13px;
  line-height: 1.3;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f7f8fb;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.sync-status--synced {
  border-color: #bfdbca;
  background: #eef8f1;
  color: #23613a;
}

.sync-status--stale {
  border-color: #f4c7c3;
  background: #fff0ef;
  color: #b3261e;
}

.sync-status--manual {
  border-color: #d6dce8;
  background: #f4f6fa;
  color: #4b5563;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.field span {
  font-weight: 750;
  color: #334155;
}

.ratio-inputs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ratio-inputs input {
  width: 80px;
  text-align: center;
}

.ratio-sep {
  font-weight: 600;
  color: var(--muted);
}

.ratio-unit {
  font-size: 12px;
  color: var(--muted);
}

.category-manager {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.category-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(57, 73, 171, 0.05);
}

#category-table input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="file"],
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: #172033;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.13);
}

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

.file-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-preview {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.file-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 4px 12px rgba(31, 36, 48, 0.08);
}

.file-preview__label {
  font-size: 13px;
  color: var(--muted);
  max-width: 160px;
  word-break: break-all;
}

.file-preview a {
  color: var(--primary);
  text-decoration: none;
}

.file-preview a:hover,
.file-preview a:focus {
  text-decoration: underline;
}

.image-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.image-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.image-link:hover,
.image-link:focus {
  text-decoration: underline;
}

.image-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.media-editor {
  margin: 18px 0 28px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

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

.media-editor__header h3 {
  margin: 0;
  font-size: 18px;
}

.product-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.product-image-list .helper {
  margin: 0;
}

.product-image-item {
  width: 160px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.product-image-item__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef2f7;
}

.product-image-item__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.product-image-item__primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}

.product-image-item__name {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.part-image-cell {
  min-width: 116px;
}

.part-image-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.part-image-control__thumb,
.product-main-image__thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.part-image-control__empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  background: #f8fafc;
}

.part-image-control__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-main-image {
  display: inline-flex;
}

.bom-summary--media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.bom-summary__images {
  justify-content: flex-end;
  max-width: 280px;
}

.helper {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.materials {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.materials__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.materials__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.material-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(160px, 1.5fr) 48px;
  gap: 12px;
  align-items: end;
}

.material-row .remove-row {
  justify-self: end;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.parts,
.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}

.parts thead,
.data-table thead {
  background: #edf3f8;
}

.parts th,
.parts td,
.data-table th,
.data-table td {
  padding: 13px 14px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.parts th,
.data-table th {
  color: #344256;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.parts tbody tr:hover,
.data-table tbody tr:hover {
  background: #f8fbff;
}

.parts tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.parts tbody td,
.data-table tbody td {
  vertical-align: middle;
}

.data-table tbody tr.is-expanded > td {
  background: rgba(57, 73, 171, 0.04);
}

#prep-table th:last-child,
#prep-table td:last-child {
  text-align: center;
  white-space: nowrap;
}

#prep-table th:nth-last-child(2),
#prep-table td:nth-last-child(2) {
  min-width: 150px;
}

#prep-table .prep-action-cell {
  min-width: 96px;
}

#prep-table .prep-action-wrap {
  justify-content: center;
}

.prep-detail-row > td {
  padding: 0;
  background: #f8fafc;
}

.prep-detail-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.prep-detail-image img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.prep-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
}

.prep-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.prep-detail-item span {
  color: var(--muted);
  font-size: 12px;
}

.prep-detail-item strong {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.prep-detail-actions {
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plan-product-cell {
  min-width: 360px;
}

#history-table tbody td {
  vertical-align: top;
}

#history-table .table-actions-cell {
  white-space: nowrap;
}

.plan-product-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-product-line {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.plan-product-line:last-child {
  border-bottom: none;
}

.plan-product-line__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.plan-product-line__order {
  font-weight: 700;
  color: var(--text);
}

.plan-product-line__code {
  color: var(--primary);
  font-weight: 600;
}

.plan-product-line__qty {
  color: var(--text);
  white-space: nowrap;
}

.plan-product-line__name,
.plan-product-line__more {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.part-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.part-select-wrapper input,
.part-select-wrapper select {
  width: 100%;
}

.parts input[type="text"],
.parts input[type="number"],
.parts input[type="file"] {
  padding: 10px 12px;
}

.parts .remove-row {
  color: var(--danger);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn--large {
  font-size: 16px;
  min-height: 46px;
  padding: 12px 20px;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.2);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.18);
}

.btn--ghost {
  background: #fff;
  color: #344256;
  border-color: var(--border);
}

.btn--ghost:hover {
  background: #edf4fb;
  border-color: #c5d2df;
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(28, 41, 61, 0.08);
}

.btn--primary {
  min-width: 140px;
  background: var(--primary);
  color: #fff;
}

.btn--danger,
.table-actions .btn--danger {
  background: rgba(217, 48, 37, 0.12);
  color: var(--danger);
  border-color: rgba(217, 48, 37, 0.3);
}

.btn--danger:hover,
.table-actions .btn--danger:hover {
  background: rgba(217, 48, 37, 0.18);
  box-shadow: none;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
}

.badge--success {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.badge--warning {
  background: rgba(234, 179, 8, 0.18);
  color: #a16207;
}

.badge--primary {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.badge--danger {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.badge--secondary {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.shipped-layout {
  display: grid;
  gap: 18px;
}

.shipped-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
}

.shipped-metric {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.shipped-metric strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.shipped-metric--primary {
  border-color: rgba(37, 99, 235, 0.28);
}

.shipped-metric--warning {
  border-color: rgba(234, 179, 8, 0.35);
}

.shipped-metric--danger {
  border-color: rgba(220, 38, 38, 0.28);
}

.shipped-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto;
  gap: 14px;
  align-items: end;
}

.shipped-filter__actions .btn {
  width: 100%;
}

.shipped-table-wrap {
  border: 1px solid var(--border);
  background: #fff;
}

.shipped-records__actions {
  justify-content: flex-end;
}

.shipped-select {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.shipped-print-exchange {
  margin-top: 8px;
}

.shipped-table th,
.shipped-table td {
  vertical-align: top;
}

.shipped-date,
.shipped-order-number,
.shipped-product,
.shipped-quantity {
  font-weight: 700;
  color: var(--text);
}

.shipped-product {
  max-width: 240px;
}

.shipped-due-date {
  margin-top: 6px;
  font-weight: 600;
}

.shipped-empty {
  padding: 24px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.button-row form {
  margin: 0;
}

.schedule-toolbar {
  justify-content: flex-end;
}

.schedule-toolbar .btn {
  min-width: auto;
}

.schedule-actions {
  gap: 6px;
  max-width: 360px;
}

.schedule-actions .btn {
  min-width: auto;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.1;
  box-shadow: none;
}

.schedule-actions .btn--primary {
  min-width: auto;
}

.schedule-hero {
  margin-bottom: 16px;
}

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

.schedule-metric {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid rgba(216, 220, 227, 0.9);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(39, 56, 84, 0.06);
}

.schedule-metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.schedule-metric strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.schedule-panel {
  padding: 0;
  overflow: hidden;
}

.schedule-panel__header {
  align-items: flex-start;
  padding: 20px 22px 14px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.schedule-panel__header .helper {
  margin-top: 6px;
  margin-bottom: 0;
}

.schedule-filter {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(220px, 1.2fr) minmax(130px, 0.6fr) minmax(130px, 0.6fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.schedule-filter .field {
  gap: 6px;
}

.schedule-field-label {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.schedule-field-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.schedule-filter .helper {
  margin: 0;
  font-size: 11px;
}

.schedule-product-picker {
  position: relative;
}

.schedule-product-picker summary {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.schedule-product-picker[open] summary {
  border-color: #93b4e8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.schedule-product-picker__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: min(360px, 90vw);
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.schedule-product-picker__option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}

.schedule-product-picker__option:hover {
  background: #f4f7fb;
}

.schedule-product-picker__option input {
  margin-top: 1px;
}

.schedule-product-picker__empty {
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}

.shipped-date-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.shipped-status-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.shipped-date-edit input[type="date"],
.shipped-status-edit select {
  width: 132px;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

.schedule-filter .btn {
  min-width: 96px;
}

.schedule-table-wrap {
  border-radius: 0;
}

.schedule-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.schedule-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  background: #f3f4f8;
  color: #4b5563;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.schedule-table td {
  padding: 14px;
  vertical-align: top;
  border-bottom: 1px solid #edf0f5;
  font-size: 14px;
}

.schedule-table tbody tr:hover {
  background: #f9fbff;
}

.schedule-select {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

.schedule-select-placeholder {
  color: #c4c9d4;
  font-size: 13px;
}

.schedule-selection-summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin: 0 0 10px;
  padding: 6px 10px;
  border: 1px solid #d9e2f1;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
}

.schedule-selection-summary strong {
  color: var(--text);
  font-size: 14px;
}

.schedule-date {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 112px;
}

.schedule-date span,
.schedule-subline,
.schedule-code {
  color: var(--muted);
  font-size: 12px;
}

.schedule-paid-check {
  margin-top: 8px;
}

.schedule-paid-check label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.schedule-paid-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.order-remark-ellipsis {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-date .is-warning {
  color: #a16207;
  font-weight: 700;
}

.schedule-date .is-danger {
  color: var(--danger);
  font-weight: 700;
}

.schedule-order-no,
.schedule-product {
  display: block;
  max-width: 220px;
  color: var(--text);
}

.schedule-same-order {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
}

.schedule-same-order span {
  color: #a16207;
  font-weight: 600;
}

.schedule-same-order-products {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.schedule-same-order-products span {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
}

.schedule-code {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.schedule-plan-link {
  display: inline-flex;
  max-width: 180px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
}

.schedule-muted-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.schedule-muted-pill.is-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.schedule-material-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.schedule-material-checks form {
  margin: 0;
}

.schedule-material-overall {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 8px;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.schedule-material-overall strong {
  justify-self: end;
  color: #0f172a;
}

.schedule-material-overall.is-ready strong {
  color: #15803d;
}

.schedule-material-bar {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.schedule-material-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.schedule-material-overall.is-ready .schedule-material-bar i {
  background: #16a34a;
}

.schedule-material-row {
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
  font-size: 12px;
  line-height: 1.2;
}

.schedule-material-row form {
  grid-column: 1;
}

.schedule-material-box-button {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.schedule-material-note-button {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(42px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: text;
  min-width: 0;
}

.schedule-material-note-button strong {
  font-size: 12px;
}

.schedule-material-note-button small {
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.schedule-material-box {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #94a3b8;
  border-radius: 3px;
  background: #fff;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.schedule-material-row.is-warning {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.schedule-material-row.is-muted {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(241, 245, 249, 0.75);
  color: #64748b;
}

.schedule-material-row.is-success {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
}

.schedule-material-row.is-checked .schedule-material-box {
  border-color: #16a34a;
  background: #16a34a;
}

.material-note-modal__body {
  width: min(560px, 100%);
}

.material-note-progress {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
}

.material-note-progress[hidden] {
  display: none;
}

.material-note-progress__head,
.material-note-progress__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.material-note-progress__head {
  color: #334155;
  font-weight: 800;
}

.material-note-progress__row {
  padding-top: 7px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
}

.material-note-progress__row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-note-progress__row small,
.material-note-progress__empty {
  color: #64748b;
}

.plan-inbound-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.plan-inbound-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #dbe4ef;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.plan-inbound-table td,
.plan-return-table td {
  vertical-align: top;
}

.schedule-kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(205px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.schedule-column {
  min-width: 205px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
  padding: 8px;
  box-shadow: 0 4px 14px rgba(39, 56, 84, 0.04);
}

.schedule-column__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.schedule-card {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
  margin-bottom: 7px;
  box-shadow: var(--shadow-sm);
}

.schedule-card strong {
  display: block;
  margin-bottom: 4px;
}

.schedule-card--compact {
  padding: 7px 8px;
}

.schedule-card--compact.is-material-missing {
  border-color: #fecdd3;
  background: #fff7f7;
}

.schedule-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.schedule-card__top strong {
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
}

.schedule-card__date {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.schedule-card__date.is-warning {
  color: #b45309;
}

.schedule-card__date.is-danger {
  color: #b91c1c;
}

.schedule-card__product {
  margin-top: 4px;
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.schedule-card__product span {
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-card__product small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.15;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-card__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
}

.schedule-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.schedule-card__meta span {
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.schedule-card__plan-link {
  flex: 0 1 auto;
  max-width: 78px;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-card__material-summary {
  display: inline-block;
  min-width: 0;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-card__material-summary.is-ready {
  background: #ecfdf5;
  color: #166534;
}

.schedule-card__material-summary.is-missing {
  background: #fee2e2;
  color: #991b1b;
}

.schedule-card__fold {
  margin-top: 5px;
  border-top: 1px solid #edf0f5;
  padding-top: 5px;
}

.schedule-card__fold summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: #475569;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
  user-select: none;
}

.schedule-card__fold summary::-webkit-details-marker {
  display: none;
}

.schedule-card__fold[open] summary {
  color: #1d4ed8;
}

.schedule-card__fold-label {
  color: #64748b;
  font-size: 11px;
}

.schedule-material-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.schedule-material-chip {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.schedule-material-chip.is-warning {
  border-color: #fbbf24;
  background: #fffbeb;
}

.schedule-material-chip.is-success {
  border-color: #86efac;
  background: #f0fdf4;
}

.schedule-material-chip.is-muted {
  color: #64748b;
}

.schedule-material-chip-check,
.schedule-material-chip-note {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.schedule-material-chip-check {
  width: 24px;
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.92);
  color: #15803d;
  line-height: 1;
}

.schedule-material-chip-box {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid #94a3b8;
  border-radius: 3px;
  background: #fff;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.schedule-material-chip.is-checked .schedule-material-chip-box {
  border-color: #16a34a;
  background: #16a34a;
}

.schedule-material-chip-note {
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 700;
}

.schedule-actions--compact {
  margin-top: 7px;
}

.schedule-actions--compact .btn {
  padding: 4px 7px;
  font-size: 11px;
}

.remove-row {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--danger);
  font-weight: 600;
}

.form__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

#debug-output {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
}

.empty-state p {
  margin: 6px 0;
}

.data-table tbody tr.is-active {
  background: rgba(57, 73, 171, 0.08);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 23, 44, 0.45);
}

.modal__body {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  padding: clamp(24px, 4vw, 36px);
  width: min(960px, 100%);
  z-index: 1001;
}

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

.modal__header h3 {
  margin: 0;
}

.modal__close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}

.modal__close:hover {
  color: var(--primary);
}

.modal__actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.bom-modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 1080px) {
  .settings-overview,
  .settings-center-grid,
  .settings-list--two {
    grid-template-columns: 1fr;
  }

  .inbound-match-grid {
    grid-template-columns: 1fr;
  }

  .inbound-scan-input-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    position: static;
  }

  .settings-side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .settings-side-nav a {
    justify-content: center;
    text-align: center;
  }

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

  .settings-card,
  .settings-card--wide {
    grid-column: 1 / -1;
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-page::before {
    display: none;
  }

  .auth-card {
    justify-self: center;
  }

  .home-feature-grid,
  .home-workflow {
    grid-template-columns: 1fr;
  }

  .home-workflow {
    gap: 28px;
  }

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

  .erp-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .settings-overview {
    padding: 16px;
  }

  .settings-overview__cards,
  .settings-two-col,
  .settings-control__row,
  .settings-add-row,
  .settings-add-row--wide {
    grid-template-columns: 1fr;
  }

  .settings-center-card__head {
    padding: 16px;
  }

  .settings-center-card > :not(.settings-center-card__head) {
    margin-left: 16px;
    margin-right: 16px;
  }

  .settings-center-card > :last-child {
    margin-bottom: 16px;
  }

  .settings-list-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-row-actions {
    justify-content: flex-start;
  }

  .settings-add-row .btn,
  .settings-control__row .btn,
  .settings-stack-form--clean .btn--primary {
    width: 100%;
  }

  .settings-shell {
    gap: 12px;
  }

  .settings-sidebar,
  .settings-panel {
    border-radius: 8px;
  }

  .settings-profile {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .settings-profile__mark {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

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

  .settings-panel__head {
    padding: 16px;
  }

  .settings-panel > :not(.settings-panel__head) {
    margin-left: 16px;
    margin-right: 16px;
  }

  .settings-panel > :last-child {
    margin-bottom: 16px;
  }

  .settings-table th:last-child,
  .settings-table td:last-child {
    width: auto;
  }

  .settings-main {
    gap: 12px;
  }

  .settings-card > .card__header {
    padding: 16px;
  }

  .settings-card > :not(.card__header) {
    margin-left: 16px;
    margin-right: 16px;
  }

  .settings-card > :last-child {
    margin-bottom: 16px;
  }

  .settings-form-grid,
  .settings-inline-form {
    grid-template-columns: 1fr;
  }

  .settings-inline-form .btn {
    width: 100%;
  }

  .home-top {
    position: absolute;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .home-brand {
    flex-direction: column;
    gap: 3px;
  }

  .home-brand strong {
    font-size: 24px;
  }

  .home-brand span {
    font-size: 13px;
  }

  .home-actions {
    justify-content: flex-end;
    gap: 8px;
  }

  .home-actions .home-button {
    font-size: 13px;
  }

  .home-hero {
    min-height: 84vh;
    align-items: flex-end;
    padding: 126px 16px 42px;
    background-position: 58% center;
  }

  .home-hero__shade {
    background:
      linear-gradient(90deg, rgba(10, 17, 32, 0.94) 0%, rgba(10, 17, 32, 0.76) 100%),
      linear-gradient(0deg, rgba(15, 23, 42, 0.76), rgba(15, 23, 42, 0.08) 46%);
  }

  .home-lead {
    line-height: 1.68;
  }

  .home-button {
    min-height: 38px;
    padding: 0 13px;
  }

  .home-section {
    padding: 42px 16px;
  }

  .home-feature {
    min-height: 0;
    padding: 20px;
  }

  .home-feature span {
    margin-bottom: 20px;
  }

  .home-steps li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .home-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: 34px 16px 42px;
  }

  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .page {
    display: block;
  }

  .page__header {
    padding: 14px 12px 6px;
  }

  .page__header--compact {
    padding: 8px 10px 4px;
  }

  .page__header-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
  }

  .page__header h1 {
    min-height: 30px;
    font-size: 22px;
    line-height: 1.15;
  }

  .page__header--compact h1 {
    min-height: 26px;
    font-size: 18px;
  }

  .page__header--icon-nav {
    padding: 5px 8px 2px;
  }

  .page__header--icon-nav .page__header-top {
    display: block;
  }

  .page__header p {
    font-size: 12px;
    line-height: 1.35;
  }

  .page__main {
    padding: 0 10px 24px;
    gap: 12px;
  }

  .page__main--flush {
    padding-top: 6px;
  }

  .page__main--tight {
    padding-top: 4px;
  }

  .kanban-page .page__main--tight {
    padding-top: 6px;
    padding-bottom: 68px;
  }

  .kanban-bottom-nav {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .kanban-bottom-nav .page__nav-toggle {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .kanban-bottom-nav .page__nav--dropdown {
    width: min(260px, calc(100vw - 20px));
  }

  .page__user {
    grid-column: 1 / -1;
    justify-content: space-between;
    width: 100%;
    min-height: 30px;
    font-size: 12px;
  }

  .page__user .page__nav-link {
    min-height: 28px;
    padding: 5px 8px;
  }

  .card {
    border-radius: 8px;
    padding: 12px;
  }

  .card__header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .card__header h2,
  .card__header h3 {
    font-size: 17px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .field label,
  .field span {
    font-size: 12px;
  }

  input,
  select,
  textarea {
    max-width: 100%;
  }

  .btn {
    min-height: 34px;
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 13px;
  }

  .btn--primary {
    min-width: 0;
  }

  .button-row {
    gap: 6px;
  }

  .table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bom-summary--media {
    grid-template-columns: 1fr;
  }

  .media-editor__header {
    align-items: stretch;
    flex-direction: column;
  }

  .product-image-item {
    width: min(100%, 180px);
  }

  .bom-summary__images {
    justify-content: flex-start;
    max-width: none;
  }

  .page__nav-shell {
    width: 100%;
    grid-column: 1 / -1;
    order: 3;
  }

  .page__nav-toggle {
    width: 100%;
    justify-content: space-between;
    min-height: 32px;
    padding: 6px 9px;
  }

  .page__header--icon-nav .page__nav-shell {
    width: auto;
  }

  .page__header--icon-nav .page__nav-toggle {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    justify-content: center;
  }

  .page__nav {
    width: 100%;
    justify-content: center;
  }

  .page__nav--dropdown {
    position: static;
    margin-top: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
    box-shadow: 0 10px 22px rgba(39, 56, 84, 0.12);
  }

  .library-actions {
    width: 100%;
    justify-content: stretch;
  }

  .library-actions .btn,
  .library-actions .btn--danger,
  .library-actions .btn--ghost {
    width: 100%;
    justify-content: center;
  }

  .production-method-switch {
    grid-template-columns: 1fr;
  }

  .production-method-switch__button {
    min-height: 64px;
  }

  .plan-line,
  .single-mold-line {
    grid-template-columns: 1fr;
  }

  .plan-line-remove {
    width: 100%;
  }

  .product-parts-order-remove {
    width: 100%;
  }

  .category-filters {
    width: 100%;
    justify-content: center;
  }

  .shipped-metrics,
  .shipped-filter {
    grid-template-columns: 1fr;
  }

  .shipped-metric {
    min-height: 70px;
  }

  .shipped-product {
    max-width: none;
  }

  .material-row {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, auto);
    align-items: center;
  }

  .material-row .remove-row {
    justify-self: start;
  }

  .card__header,
  .materials__header,
  .form__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .schedule-hero {
    margin-bottom: 10px;
  }

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

  .schedule-metric {
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 8px;
  }

  .schedule-metric span {
    font-size: 11px;
  }

  .schedule-metric strong {
    font-size: 20px;
  }

  .schedule-panel__header {
    padding: 12px;
  }

  .schedule-panel__header .helper {
    font-size: 12px;
  }

  .schedule-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    justify-content: stretch;
  }

  .schedule-toolbar .btn,
  .schedule-toolbar form,
  .schedule-toolbar form .btn {
    width: 100%;
    min-width: 0;
  }

  .schedule-filter {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .schedule-filter .btn {
    width: 100%;
  }

  .schedule-table {
    min-width: 940px;
  }

  .schedule-table th {
    padding: 9px 10px;
    font-size: 11px;
  }

  .schedule-table td {
    padding: 10px;
    font-size: 12px;
  }

  .schedule-material-note-button {
    grid-template-columns: minmax(36px, auto) minmax(0, 1fr);
  }

  .schedule-actions {
    max-width: none;
  }

  .schedule-kanban {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-x: visible;
  }

  .schedule-column {
    min-width: 0;
    padding: 7px;
  }

  .schedule-column__header {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: -7px -7px 6px;
    padding: 7px;
    background: rgba(248, 250, 252, 0.96);
    border-bottom: 1px solid var(--border);
  }

  .schedule-card {
    margin-bottom: 6px;
  }

  .schedule-card__product {
    grid-template-columns: minmax(64px, 0.72fr) minmax(0, 1fr);
  }

  .schedule-card__meta span {
    font-size: 10.5px;
  }

  .schedule-material-strip {
    gap: 3px;
  }

  .schedule-material-chip-note {
    padding: 3px 5px;
  }

  .modal {
    padding: 0;
  }

  .modal__body {
    width: 100%;
    max-height: 92vh;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    align-self: flex-end;
  }

  .schedule-plan-modal__body {
    width: 100%;
    max-width: 100%;
    height: 92vh;
  }

  .parts th,
  .parts td,
  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }
}
