﻿:root {
  --brand: #0b3e6f;
  --brand-strong: #072f55;
  --brand-soft: #edf4fc;
  --brand-soft-2: #f5f9fe;
  --gold-soft: #f8b54a;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --line: #dbe3ec;
  --line-strong: #c7d4e0;
  --text: #16202b;
  --muted: #6c7a89;
  --success: #1f8f5f;
  --warn: #d5a122;
  --danger: #d44f4f;
  --shadow-sm: 0 8px 20px rgba(12, 40, 74, 0.08);
  --shadow: 0 18px 38px rgba(12, 40, 74, 0.10);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(11, 62, 111, 0.08), transparent 22%),
    radial-gradient(circle at right top, rgba(11, 62, 111, 0.06), transparent 24%),
    var(--bg);
}

body.modal-open {
  overflow: hidden;
}

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

button {
  border: none;
}

img {
  display: block;
  max-width: 100%;
}

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

.hidden {
  display: none !important;
}

.app-version-mark {
  position: fixed;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 40;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.38);
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.brand-kicker,
.section-kicker {
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-desc,
.field-label,
.form-message,
.data-meta,
.card-meta,
.user-brief span,
.empty-state,
.trial-note,
.brand-subtitle {
  color: var(--muted);
}

.brand-subtitle.small {
  font-size: 13px;
}

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

.brand-logo {
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(11, 62, 111, 0.18);
}

.hero-brand-logo {
  width: 84px;
  height: 84px;
}

.sidebar-brand-logo {
  width: 56px;
  height: 56px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  gap: 28px;
  padding: 24px;
}

.login-brand-panel,
.login-panel,
.sidebar,
.topbar,
.page-view,
.surface-card,
.feature-card,
.metric-card,
.form-card,
.detail-card,
.list-card,
.trial-card,
.tip-card,
.stat-card,
.print-card,
.help-card {
  background: var(--panel);
  border: 1px solid rgba(219, 227, 236, 0.92);
  box-shadow: var(--shadow);
}

.login-brand-panel,
.login-panel,
.sidebar,
.topbar,
.page-view {
  border-radius: var(--radius-xl);
}

.login-brand-panel {
  padding: 42px;
  display: grid;
  align-content: space-between;
  gap: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 249, 254, 0.98)),
    var(--panel);
}

.login-brand-panel h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
}

.brand-feature-list,
.trial-account-list,
.metrics-grid,
.quick-grid,
.grid-2,
.grid-3,
.form-grid,
.detail-grid,
.info-grid,
.login-tips-grid,
.nav-menu,
.page-stack,
.shipment-form-grid,
.trial-grid {
  display: grid;
  gap: 16px;
}

.brand-feature-list,
.metrics-grid,
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.feature-card,
.tip-card,
.metric-card,
.stat-card,
.help-card {
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.feature-card strong,
.tip-card strong,
.metric-card strong,
.stat-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.feature-card span,
.tip-card span,
.metric-card span,
.stat-card span {
  display: block;
  line-height: 1.6;
}

.trial-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  display: grid;
  gap: 14px;
}

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

.trial-account-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: 0.2s ease;
}

.trial-account-item:hover {
  border-color: rgba(11, 62, 111, 0.32);
  box-shadow: var(--shadow-sm);
}

.trial-account-item strong {
  font-size: 15px;
}

.login-panel {
  align-self: center;
  padding: 32px;
  display: grid;
  gap: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading.compact h3,
.section-heading h2,
.section-heading h3 {
  margin-bottom: 8px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.login-form label,
.form-grid label,
.password-form label,
.shipment-form-grid label {
  display: grid;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  min-height: 46px;
  padding: 0 14px;
  transition: 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(11, 62, 111, 0.44);
  box-shadow: 0 0 0 4px rgba(11, 62, 111, 0.08);
}

textarea {
  min-height: 96px;
  padding-top: 12px;
  resize: vertical;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
}

.primary-button,
.secondary-button,
.ghost-button,
.nav-item,
.text-button {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand) 0%, #1d5d96 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(11, 62, 111, 0.18);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.nav-item:hover,
.trial-account-item:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.primary-button-lg {
  min-height: 50px;
  font-size: 15px;
}

.secondary-button {
  background: var(--brand-soft);
  color: var(--brand);
}

.ghost-button {
  background: #f4f6f9;
  color: var(--text);
}

.button-full {
  width: 100%;
}

.button-print {
  background: #fff7ea;
  color: #8f5b05;
}

.text-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--brand);
  font-weight: 700;
}

.badge,
.status-pill,
.alert-pill,
.nav-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge {
  padding: 8px 12px;
}

.badge-brand,
.status-running,
.alert-ok {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-soft {
  background: #eef3f8;
  color: var(--muted);
}

.status-pending,
.alert-warn {
  background: #fff3d8;
  color: #966100;
}

.status-danger,
.alert-danger {
  background: #fdeceb;
  color: var(--danger);
}

.dashboard-shell {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
  overflow: hidden;
}

.sidebar {
  height: calc(100vh - 44px);
  position: sticky;
  top: 22px;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 18px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

.sidebar-top {
  display: grid;
  gap: 18px;
}

.sidebar-brand-lockup {
  align-items: flex-start;
}

.sidebar-brand-lockup h2 {
  margin-bottom: 4px;
}

.nav-menu {
  align-content: start;
}

.nav-item {
  width: 100%;
  min-height: 48px;
  text-align: left;
  padding: 0 14px;
  border-radius: 15px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  border: 1px solid transparent;
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(11, 62, 111, 0.12);
  box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-bottom {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.user-brief {
  display: grid;
  gap: 6px;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
}

.content-area {
  height: calc(100vh - 44px);
  overflow: auto;
  padding-right: 4px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.content-area::-webkit-scrollbar {
  width: 10px;
}

.content-area::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(11, 62, 111, 0.14);
}

.topbar {
  padding: 24px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.topbar h1 {
  margin-bottom: 10px;
}

.topbar-right {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.topbar-user-card {
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  display: grid;
  gap: 4px;
}

.inline-alert {
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff4dc;
  color: #8f5b05;
  font-size: 13px;
  font-weight: 700;
}

.page-view {
  padding: 24px 28px 28px;
  display: grid;
  gap: 18px;
}

.page-stack {
  align-content: start;
}

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

.metric-card,
.stat-card {
  border-radius: 18px;
}

.metric-card strong,
.stat-card strong {
  font-size: 28px;
  line-height: 1.1;
  margin-top: 10px;
}

.list-card,
.form-card,
.detail-card,
.print-card {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.form-card,
.detail-card,
.list-card,
.print-card {
  display: grid;
  gap: 16px;
}

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

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

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .full,
.shipment-form-grid .full,
.password-form .full {
  grid-column: 1 / -1;
}

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

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

.info-cell,
.detail-cell {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.info-cell strong,
.detail-cell strong {
  display: block;
  margin-bottom: 6px;
}

.section-divider {
  height: 1px;
  background: var(--line);
}

.toolbar {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr auto auto;
  gap: 14px;
  align-items: end;
}

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

.card-list {
  display: grid;
  gap: 14px;
}

.record-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.record-card.is-warning {
  border-color: rgba(213, 161, 34, 0.45);
  background: #fffdf6;
}

.record-card.is-danger {
  border-color: rgba(212, 79, 79, 0.4);
  background: #fff8f8;
}

.record-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.record-title {
  font-size: 17px;
  font-weight: 800;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.record-grid .record-field {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.record-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  background: #fbfcfe;
}

.table-wrap {
  overflow: auto;
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 700;
}

.status-pill,
.alert-pill {
  padding: 6px 10px;
}

.status-neutral {
  background: #eef2f6;
  color: #56616e;
}

.password-form {
  display: grid;
  gap: 16px;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 22, 35, 0.46);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-panel {
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 28px 56px rgba(7, 28, 54, 0.22);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #f3f6fa;
  color: var(--text);
}

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

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 120;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.5;
}

.toast.success {
  background: linear-gradient(135deg, #1d8f5f 0%, #3dad78 100%);
}

.toast.error {
  background: linear-gradient(135deg, #c84747 0%, #e06a6a 100%);
}

.toast.info {
  background: linear-gradient(135deg, var(--brand) 0%, #1f5f96 100%);
}

.print-sheet {
  font-family: "Microsoft YaHei", sans-serif;
  color: #1b2430;
  padding: 24px;
}

.print-sheet h1,
.print-sheet h2,
.print-sheet h3 {
  margin-bottom: 10px;
}

.print-sheet .sheet-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.print-sheet .sheet-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
}

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

.print-sheet .sheet-cell {
  border: 1px solid #d7dde5;
  border-radius: 10px;
  padding: 10px 12px;
}

.print-sheet .sheet-cell span {
  display: block;
  font-size: 12px;
  color: #6b7785;
  margin-bottom: 6px;
}

.print-sheet .sheet-signatures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.print-sheet .signature-box {
  min-height: 72px;
  border-bottom: 1px solid #9ba7b5;
}

@media print {
  body {
    background: #fff;
  }
}

@media (max-width: 1280px) {
  .brand-feature-list,
  .metrics-grid,
  .grid-3,
  .form-grid,
  .form-grid.compact,
  .shipment-form-grid,
  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar .toolbar-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px), (pointer: coarse) and (hover: none) {
  .login-shell,
  .dashboard-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .dashboard-shell {
    overflow: visible;
  }

  .sidebar,
  .content-area {
    height: auto;
    position: static;
    overflow: visible;
  }

  .sidebar {
    order: 1;
  }

  .content-area {
    order: 2;
  }

  .topbar,
  .section-heading,
  .record-header,
  .brand-lockup,
  .trial-account-list,
  .metrics-grid,
  .grid-2,
  .grid-3,
  .detail-grid,
  .info-grid,
  .record-grid,
  .form-grid,
  .form-grid.compact,
  .shipment-form-grid,
  .toolbar,
  .login-tips-grid,
  .brand-feature-list {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-heading,
  .record-header {
    display: grid;
  }

  .topbar-right {
    justify-items: stretch;
  }
}

@media (max-width: 720px) {
  .login-shell,
  .dashboard-shell {
    padding: 14px;
    gap: 14px;
  }

  .login-brand-panel,
  .login-panel,
  .sidebar,
  .topbar,
  .page-view,
  .list-card,
  .form-card,
  .detail-card,
  .trial-card,
  .modal-panel {
    padding: 18px;
  }

  .record-grid,
  .info-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .action-row,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .trial-account-list {
    grid-template-columns: 1fr;
  }
}
a.secondary-button,
a.ghost-button,
a.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--success);
}

.section-desc,
.record-meta,
.data-meta {
  line-height: 1.6;
}

:root {
  --bg: #f7f9fc;
  --panel-soft: #f8fbff;
  --line: #d9e2ec;
  --line-strong: #c6d4e2;
  --shadow-sm: 0 8px 18px rgba(12, 40, 74, 0.06);
  --shadow: 0 18px 38px rgba(12, 40, 74, 0.08);
}

body {
  background:
    radial-gradient(circle at top left, rgba(11, 62, 111, 0.07), transparent 22%),
    radial-gradient(circle at right top, rgba(11, 62, 111, 0.04), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}

.brand-logo {
  box-shadow: 0 14px 28px rgba(11, 62, 111, 0.12);
}

.login-shell {
  gap: 24px;
  padding: 20px;
  align-items: stretch;
}

.login-brand-panel {
  position: relative;
  padding: 40px;
  border: 1px solid rgba(214, 224, 235, 0.96);
  overflow: hidden;
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(11, 62, 111, 0.08), transparent 24%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(244, 248, 253, 0.96));
  pointer-events: none;
}

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

.login-brand-panel h1 {
  font-size: clamp(32px, 3.4vw, 48px);
  margin-bottom: 12px;
}

.login-panel {
  padding: 34px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.trial-account-item {
  gap: 8px;
  padding: 15px 16px;
  border-radius: 14px;
}

.trial-account-item strong {
  font-size: 14px;
  color: var(--brand);
}

.dashboard-shell {
  grid-template-columns: 278px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.sidebar {
  height: calc(100vh - 36px);
  top: 18px;
  padding: 18px 16px 16px;
  border: 1px solid rgba(214, 224, 235, 0.96);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.sidebar-top {
  gap: 16px;
}

.nav-menu {
  gap: 8px;
}

.nav-item {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.nav-item:hover {
  background: #f5f9fe;
  border-color: rgba(11, 62, 111, 0.12);
  color: var(--brand);
  transform: none;
}

.nav-item.active {
  background: linear-gradient(180deg, #eef5ff 0%, #e6f0ff 100%);
  border-color: rgba(11, 62, 111, 0.16);
  box-shadow: inset 4px 0 0 var(--brand);
}

.user-brief {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
}

.sidebar-actions {
  gap: 8px;
}

.content-area {
  height: calc(100vh - 36px);
  gap: 16px;
  padding-right: 2px;
}

.topbar {
  padding: 22px 24px;
}

.page-view {
  padding: 22px 24px 26px;
}

.list-card,
.form-card,
.detail-card,
.print-card {
  padding: 18px;
}

.section-heading h2,
.section-heading h3 {
  line-height: 1.25;
}

.toolbar label {
  display: grid;
  gap: 8px;
}

.toolbar-order-search {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.toolbar-order-search .toolbar-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

#tasksView .production-task-field-filter {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
}

#tasksView .production-task-field-filter input,
#tasksView .production-task-field-filter select {
  width: 100%;
  min-width: 0;
}

#tasksView .production-task-field-filter .toolbar-actions {
  grid-column: auto;
  justify-content: flex-end;
}

.password-helper {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(11, 62, 111, 0.1);
  background: #f5f9ff;
  color: var(--muted);
  line-height: 1.7;
}

.bom-guide .info-cell {
  min-height: 92px;
}

.button-print {
  background: #fff4de;
  color: #855200;
}

.button-print:hover {
  background: #ffe9bf;
}

@media (max-width: 1280px) {
  .toolbar-order-search {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #tasksView .production-task-field-filter {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px), (pointer: coarse) and (hover: none) {
  .toolbar-order-search {
    grid-template-columns: 1fr;
  }

  #tasksView .production-task-field-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-order-search .toolbar-actions {
    justify-content: stretch;
  }

  #tasksView .production-task-field-filter .toolbar-actions {
    grid-column: 1 / -1;
  }
}



/* ===== Order Ledger Table (Excel-style) ===== */
.order-ledger-table{width:100%;border-collapse:collapse;font-size:13px;white-space:nowrap;}
.order-ledger-table th{background:#f5f5f5;padding:6px 8px;border:1px solid #ddd;text-align:center;font-weight:600;position:sticky;top:0;z-index:1;}
.order-ledger-table td{padding:4px 8px;border:1px solid #ddd;vertical-align:middle;}
.order-ledger-table td.center{text-align:center;}
.order-ledger-table tbody tr:hover{background:#f0f7ff;}
.factory-customer-group-row td{background:#e8f4e8;font-weight:600;padding:6px 8px;}
.factory-customer-summary{display:flex;gap:16px;align-items:center;flex-wrap:wrap;}

/* Production task overview buttons */
#tasksView .production-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  row-gap: 10px;
  padding: 10px 0 12px;
  align-items: center;
}

#tasksView .process-overview-button {
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid #b8c5d4;
  border-radius: 18px;
  background: #f4f7fb;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

#tasksView .process-overview-button strong {
  font-size: 15px;
  font-weight: 700;
}

#tasksView .process-overview-button span {
  font-size: 13px;
  opacity: 0.82;
}

#tasksView .process-overview-button:not(.is-active):hover {
  background: #eaf1f8;
  border-color: #7f94ad;
}

#tasksView .process-overview-button.is-active {
  background: #0b3e6f;
  border-color: #0b3e6f;
  color: #fff;
  box-shadow: 0 1px 4px rgba(11, 62, 111, 0.2);
}

#tasksView .process-overview-button.is-active span {
  opacity: 0.95;
}

#tasksView .production-hidden-head {
  display: none;
}

#tasksView .production-task-table-shell {
  overflow: visible;
}

#tasksView .production-task-fixed-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: block;
  padding: 0;
  background: #eef2f6;
  border-bottom: 2px solid #d0d5dd;
}

#tasksView .production-task-fixed-head table,
#tasksView .production-task-table table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

#tasksView .production-task-fixed-head th {
  padding: 8px 6px;
  border: 1px solid #d0d5dd;
  border-top: 0;
  background: #eef2f6;
  color: #263646;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

#tasksView .task-col-action {
  width: 124px;
}

#tasksView .task-col-index {
  width: 44px;
}

#tasksView .task-col-model {
  width: 96px;
}

#tasksView .task-col-color {
  width: 82px;
}

#tasksView .task-col-spec {
  width: 150px;
}

#tasksView .task-col-wall,
#tasksView .task-col-lock {
  width: 62px;
}

#tasksView .task-col-leg {
  width: 68px;
}

#tasksView .task-col-customer {
  width: 116px;
}

#tasksView .production-task-table-shell.is-inbound-task-table .task-col-remark {
  width: 170px;
}

#tasksView .task-col-done {
  width: 118px;
}

#tasksView .legacy-order-actions {
  padding-left: 6px;
  padding-right: 6px;
}

#tasksView .production-task-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

#tasksView .inbound-batch-check {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #86efac;
  border-radius: 6px;
  background: #f0fdf4;
  cursor: pointer;
}

#tasksView .inbound-batch-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #16a34a;
  cursor: pointer;
}

#tasksView .inbound-force-batch-check {
  border-color: #fdba74;
  background: #fff7ed;
}

#tasksView .inbound-force-batch-check input {
  accent-color: #ea580c;
}

#tasksView .inbound-force-batch-editor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 5px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fffaf3;
  color: #9a3412;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

#tasksView .inbound-force-batch-editor.hidden {
  display: none;
}

#tasksView .inbound-force-batch-editor label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
}

#tasksView .inbound-force-batch-editor input {
  width: 42px;
  height: 22px;
  padding: 0 3px;
  border: 1px solid #fdba74;
  border-radius: 4px;
  background: #fff;
  color: #7c2d12;
  font-size: 12px;
  text-align: center;
}

#tasksView .inbound-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 6px;
  padding: 8px 10px;
  border: 1px solid #bbf7d0;
  border-left: 5px solid #22c55e;
  border-radius: 8px;
  background: #f6fef8;
}

#tasksView .inbound-batch-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #14532d;
  font-size: 13px;
  white-space: nowrap;
}

#tasksView .inbound-batch-summary strong {
  font-size: 14px;
}

#tasksView .inbound-batch-summary span {
  color: #4b5f73;
}

#tasksView .inbound-batch-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#tasksView .inbound-batch-button {
  min-height: 30px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
}

#tasksView .inbound-batch-select-button {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
}

#tasksView .inbound-batch-submit-button {
  border-color: #15803d;
  background: #16a34a;
  color: #fff;
  font-weight: 800;
}

#tasksView .inbound-batch-submit-button:hover:not(:disabled) {
  border-color: #166534;
  background: #15803d;
}

#tasksView .inbound-batch-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

#tasksView .inbound-undo-blocked-label {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

#tasksView .production-task-action-button {
  min-width: 52px;
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
}

#tasksView .production-task-action-button.ghost-button {
  border: 1px solid #cbd5e1;
  background: #f7f9fc;
}

#tasksView .production-task-action-button.inbound-force-button {
  color: #9a3412;
  border-color: #fb923c;
  background: #fff7ed;
  font-weight: 800;
}

#tasksView .production-task-action-button.inbound-force-button:hover {
  background: #ffedd5;
  border-color: #f97316;
}

#tasksView .production-task-action-button.inbound-normal-button {
  color: #fff;
  border-color: #15803d;
  background: #16a34a;
  font-weight: 800;
}

#tasksView .production-task-action-button.inbound-normal-button:hover {
  background: #15803d;
  border-color: #166534;
}

#tasksView .production-date-row.production-inbound-group-ready td {
  background: #eaf8ef;
  border-left: 5px solid #22c55e;
}

#tasksView .production-date-row.production-inbound-group-force td {
  background: #fff1e8;
  border-left: 5px solid #f97316;
}

#tasksView .production-date-row.production-inbound-group-done td {
  background: #eff6ff;
  border-left: 5px solid #60a5fa;
}

#tasksView .production-date-row.production-normal-group-pending td {
  background: #f6fef8;
  border-left: 5px solid #22c55e;
}

#tasksView .production-date-row.production-normal-group-done td {
  background: #f8fafc;
  border-left: 5px solid #94a3b8;
}

#tasksView .production-date-row.production-normal-group-locked td {
  background: #eff6ff;
  border-left: 5px solid #60a5fa;
}

#tasksView .production-date-section-title {
  min-width: 98px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff;
  color: #263646;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

#tasksView .production-normal-group-pending .production-date-section-title {
  color: #15803d;
}

#tasksView .production-normal-group-done .production-date-section-title {
  color: #475569;
}

#tasksView .production-normal-group-locked .production-date-section-title {
  color: #1d4ed8;
}

#tasksView .production-date-row.production-inbound-group-ready .production-date-summary-main strong {
  color: #15803d;
}

#tasksView .production-date-row.production-inbound-group-force .production-date-summary-main strong {
  color: #c2410c;
}

#tasksView .production-date-row.production-inbound-group-done .production-date-summary-main strong {
  color: #1d4ed8;
}

#tasksView .production-task-table tr.is-inbound-ready-row td {
  background: #f6fef8;
}

#tasksView .production-task-table tr.is-inbound-force-row td {
  background: #fff8f1;
}

#tasksView .production-task-table tr.is-inbound-done-row td {
  background: #f4f8ff;
}

#tasksView .production-task-table tr.is-inbound-ready-row:hover td {
  background: #ecfdf3;
}

#tasksView .production-task-table tr.is-inbound-force-row:hover td {
  background: #ffedd5;
}

#tasksView .production-date-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
}

#tasksView .production-date-summary-main,
#tasksView .production-date-summary-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

#tasksView .production-date-summary-main {
  color: #263646;
}

#tasksView .production-date-summary-stat {
  padding-left: 18px;
  border-left: 1px solid #cbd5e1;
  color: #0b3e6f;
}

#tasksView .production-date-label {
  color: #667688;
  font-weight: 600;
}

#tasksView .inbound-task-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #4b5f73;
  font-size: 13px;
}

#tasksView .inbound-requirement-cell {
  max-width: 170px;
}

#tasksView .inbound-requirement-text,
#tasksView .today-inbound-remark span {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.35;
  max-height: 2.7em;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#tasksView .production-status-badge {
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

#tasksView .status-badge-done {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

#tasksView .status-badge-pending {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b42318;
}

#tasksView .status-badge-ready {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

#tasksView .status-badge-muted {
  background: #eef2f6;
  border-color: #cbd5e1;
  color: #64748b;
}

#tasksView .task-progress-cell .production-status-badge,
#tasksView .production-task-actions .production-status-badge {
  min-width: 62px;
}

#tasksView .today-inbound-card {
  padding: 12px;
}

#tasksView .today-inbound-table {
  min-width: 840px;
  width: 100%;
  font-size: 12px;
  table-layout: fixed;
}

#tasksView .today-inbound-table th,
#tasksView .today-inbound-table td {
  vertical-align: middle;
}

#tasksView .today-inbound-time-head,
#tasksView .today-inbound-time-cell {
  white-space: nowrap;
  width: 78px;
}

#tasksView .today-inbound-action-head,
#tasksView .today-inbound-action-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  background: #fff;
}

#tasksView .today-inbound-table thead .today-inbound-action-head {
  z-index: 3;
}

#tasksView .today-inbound-remark {
  width: 170px;
  max-width: 170px;
}

#tasksView .today-inbound-remark span {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#tasksView .inbound-task-quantity {
  display: grid;
  gap: 2px;
  color: #263646;
  font-size: 12px;
  line-height: 1.35;
}

#tasksView .inbound-task-quantity span {
  color: #667688;
}

#tasksView .inbound-force-summary {
  border-color: #f0c36a;
  background: #fff8e6;
}

#tasksView .inbound-order-card.is-inbound-ready {
  border-color: #86efac;
  background: #f0fdf4;
}

#tasksView .inbound-order-card.is-inbound-waiting {
  border-color: #fca5a5;
  background: #fef2f2;
}

#tasksView .inbound-order-card.is-inbound-done {
  border-color: #93c5fd;
  background: #eff6ff;
}

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

.lock-side-card,
.inbound-lock-side-card {
  gap: 8px;
}

.lock-side-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #526273;
  font-size: 12px;
  line-height: 1.4;
}

.inbound-lock-side-card .lock-side-hint {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}

@media (max-width: 720px) {
  .lock-side-grid {
    grid-template-columns: 1fr;
  }
}
.factory-customer-summary strong{min-width:100px;}
.factory-customer-summary span{color:#555;}
.factory-order-row td:first-child{font-weight:500;}
.ledger-col-model{width:80px;}
.ledger-col-color{width:70px;}
.ledger-col-spec{width:100px;}
.ledger-col-wall{width:55px;}
.ledger-col-lock{width:55px;}
.ledger-col-total{width:55px;}
.ledger-col-customer{width:80px;}
.ledger-col-remark{min-width:100px;}
.ledger-col-date{width:90px;}
.ledger-col-action{width:50px;}
.order-filter-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:end;padding:12px;background:#fafafa;border:1px solid #eee;border-radius:6px;margin-bottom:12px;}
.order-filter-toolbar label{display:flex;flex-direction:column;gap:2px;font-size:12px;color:#666;}
.order-filter-toolbar label .field-label{font-size:11px;}
.order-filter-toolbar input,.order-filter-toolbar select{padding:4px 6px;border:1px solid #ccc;border-radius:4px;font-size:13px;}
.order-filter-toolbar .toolbar-actions{display:flex;gap:6px;align-items:end;padding-bottom:2px;}
.filter-notice{padding:6px 12px;background:#fff8e1;border:1px solid #ffe082;border-radius:4px;font-size:13px;color:#795548;margin-bottom:8px;}
.batch-order-excel-import{display:flex;flex-direction:column;gap:6px;padding:12px;background:#f9f9f9;border:1px solid #eee;border-radius:6px;margin-bottom:12px;}
.batch-order-excel-import textarea{min-height:80px;font-family:monospace;font-size:12px;padding:8px;border:1px solid #ccc;border-radius:4px;}
.batch-order-header{display:flex;flex-wrap:wrap;gap:12px;padding:12px;}
.batch-order-header label{display:flex;flex-direction:column;gap:2px;font-size:12px;color:#666;}
.batch-order-footer{display:flex;justify-content:space-between;align-items:center;padding:12px;border-top:1px solid #eee;}
.import-preview{margin:8px 0;padding:8px;background:#f5f5f5;border:1px solid #ddd;border-radius:4px;max-height:300px;overflow:auto;}
.import-preview-table{width:100%;border-collapse:collapse;font-size:12px;margin-top:6px;}
.import-preview-table th,.import-preview-table td{padding:3px 6px;border:1px solid #ddd;text-align:left;white-space:nowrap;}
.import-preview-table th{background:#eee;font-weight:600;}
.batch-order-form{display:flex;flex-direction:column;gap:8px;padding:12px;background:#fff;border:1px solid #e0e0e0;border-radius:6px;}
.batch-order-rows{display:flex;flex-direction:column;gap:6px;}
.batch-order-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:6px;background:#fafafa;border:1px solid #eee;border-radius:4px;}
.batch-order-row input{padding:4px 6px;border:1px solid #ccc;border-radius:4px;font-size:12px;width:90px;}
.batch-order-row input[type="number"]{width:60px;}
.batch-order-row input[type="date"]{width:120px;}
.batch-order-actions{display:flex;gap:8px;justify-content:flex-end;padding:8px 0;}
/* ===== Order Import Preview ===== */
.import-preview-header{display:flex;align-items:center;gap:12px;padding:6px 0;border-bottom:1px solid #ddd;margin-bottom:6px;flex-wrap:wrap;}
.import-preview-header strong{font-size:14px;}
.import-preview-header span{font-size:12px;color:#666;}
.import-preview-actions{margin-left:auto;}
.import-preview-footer{padding:8px 0;text-align:right;border-top:1px solid #ddd;margin-top:6px;}
.import-error-row td{background:#fff0f0;}
.import-error-row .import-cell-error{color:#d32f2f;font-size:11px;white-space:normal;max-width:120px;}
.import-error-count{color:#d32f2f;font-weight:600;}
.import-delete-btn{font-size:11px;padding:2px 6px;}
.import-entry-points{display:flex;gap:12px;flex-wrap:wrap;}
.import-entry{display:flex;flex-direction:column;gap:4px;flex:1;min-width:200px;}
.import-entry .field-label{font-size:12px;font-weight:600;color:#1b5e20;}
.import-entry-actions{display:flex;gap:8px;align-items:center;padding:4px 0;}
.import-badge-group{display:flex;gap:6px;}
.import-badge-group .status-pill{font-size:11px;padding:2px 8px;}

/* ===== Order Stats Compact ===== */
.order-stats-compact .metric-card{padding:8px 12px;}
.order-stats-compact .metric-card strong{font-size:16px;}
.order-stats-compact .metric-card .data-meta{font-size:11px;}

/* ===== Order New Card ===== */
.order-new-card{border:2px solid #4caf50;}

/* ===== Order Row Edited Highlight ===== */
.factory-order-row.is-just-edited td{background:#e8f5e9 !important;transition:background 2s;}

/* ===== Batch Order Row Simple ===== */
.batch-order-row input[type="number"]{width:60px;}
.batch-order-row input[type="date"]{width:120px;}
.batch-order-row input{width:90px;}

.order-filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  width: 100%;
}

.order-filter-fields label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 88px;
  flex: 1 1 92px;
}

.order-filter-fields input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
}

.order-filter-fields .toolbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
}

.batch-order-form-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.batch-order-form-compact > input {
  width: 140px;
  max-width: 100%;
}

.batch-order-form-compact .primary-button {
  height: 30px;
}

.batch-order-toolbar {
  flex: 1 0 100%;
}

.batch-order-ledger-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.batch-order-ledger-row {
  display: grid;
  grid-template-columns: 28px minmax(80px, 1fr) minmax(70px, .8fr) minmax(110px, 1.3fr) 62px 58px 58px 74px minmax(90px, 1fr) minmax(110px, 1.3fr) 52px;
  gap: 4px;
  align-items: center;
  padding: 5px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
}

.batch-order-ledger-row input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-size: 12px;
  box-sizing: border-box;
}

.batch-order-ledger-row .batch-row-index {
  color: #667085;
  font-size: 12px;
  text-align: center;
}

.batch-order-ledger-row .batch-copy-button {
  height: 28px;
  padding: 3px 8px;
  font-size: 12px;
}

@media (max-width: 980px), (pointer: coarse) and (hover: none) {
  .batch-order-ledger-row {
    grid-template-columns: 26px repeat(2, minmax(90px, 1fr));
  }
}

.order-ledger-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #eef2f6;
  border: 1px solid #d6dde8;
  border-radius: 6px;
  color: #334155;
  font-size: 13px;
}

.order-ledger-summary span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding-right: 12px;
  border-right: 1px solid #cbd5e1;
}

.order-ledger-summary span:last-child {
  border-right: 0;
}

.order-ledger-summary strong {
  color: #0b3e6f;
  font-size: 14px;
}

.order-ledger-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.order-ledger-polished {
  width: 100%;
  min-width: 900px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.order-ledger-polished th,
.order-ledger-polished td {
  height: 32px;
  padding: 4px 7px;
  border: 0;
  border-right: 1px solid #e1e7ef;
  border-bottom: 1px solid #e1e7ef;
  vertical-align: middle;
  line-height: 20px;
  box-sizing: border-box;
}

.order-ledger-polished th:last-child,
.order-ledger-polished td:last-child {
  border-right: 0;
}

.order-ledger-polished thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e8edf4;
  color: #1f2937;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.order-ledger-polished .order-ledger-data-row td,
.order-ledger-polished .order-ledger-edit-row td {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.order-ledger-polished .center {
  text-align: center;
}

.order-ledger-polished .remark-cell {
  max-width: 220px;
}

.order-col-action { width: 92px; }
.order-col-model { width: 110px; }
.order-col-color { width: 84px; }
.order-col-spec { width: 150px; }
.order-col-wall { width: 64px; }
.order-col-lock { width: 60px; }
.order-col-leg { width: 68px; }
.order-col-customer { width: 120px; }
.order-col-remark { width: auto; }

.order-date-head td {
  height: 34px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

.order-customer-head td {
  height: 30px;
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.order-group-line {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.order-group-line span {
  color: #64748b;
  font-weight: 500;
}

.order-group-line.is-customer strong {
  color: #0b3e6f;
}

.order-ledger-data-row:hover {
  background: #f5f9ff;
}

.order-ledger-actions {
  text-align: center;
  white-space: nowrap;
}

.order-ledger-edit-row .order-ledger-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.order-ledger-edit-button,
.order-ledger-edit-row .edit-btn {
  min-width: 0;
  height: 24px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 20px;
}

.order-ledger-edit-row .edit-btn {
  margin: 0 1px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.order-ledger-edit-row .edit-btn.save {
  background: #0b3e6f;
  color: #fff;
  border-color: #0b3e6f;
}

.order-ledger-edit-row .edit-btn.cancel {
  background: #fff;
  color: #475569;
}

.order-ledger-edit-row input {
  width: 100%;
  height: 24px;
  min-width: 0;
  margin: 0;
  padding: 1px 4px;
  border: 1px solid #b6c2d2;
  border-radius: 3px;
  background: #fff;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 20px;
}

.order-ledger-edit-row td {
  height: 32px;
  padding: 3px 5px;
  background: #fffdf5;
}

.order-ledger-saved-row {
  animation: order-ledger-saved-flash 1.2s ease-out;
}

@keyframes order-ledger-saved-flash {
  from { background: #fff3bf; }
  to { background: transparent; }
}

.finished-inventory-page .detail-card {
  margin-bottom: 0;
}

.finished-inventory-filter {
  align-items: end;
  gap: 8px;
}

.finished-inventory-filter label {
  min-width: 120px;
}

.finished-inventory-filter input,
.finished-inventory-filter select {
  min-width: 0;
  height: 34px;
  border-radius: 4px;
}

.finished-inventory-table-wrap {
  background: #fff;
  border: 1px solid #b8c0cc;
  border-radius: 0;
}

.finished-inventory-table {
  width: 100%;
  min-width: 980px;
  font-size: 12px;
  border-collapse: collapse;
  border-radius: 0;
  table-layout: fixed;
}

.finished-inventory-table th,
.finished-inventory-table td {
  white-space: nowrap;
  vertical-align: middle;
  padding: 5px 8px;
  border: 1px solid #c5ccd6;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finished-inventory-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef1f5;
  color: #253040;
  text-align: center;
  font-weight: 700;
}

.finished-inventory-table tbody tr:nth-child(even) td {
  background: #f6fbff;
}

.finished-inventory-table tbody tr:hover td {
  background: #eaf4ff;
}

.finished-inventory-table .center {
  text-align: center;
}

.finished-inventory-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.finished-inventory-remark {
  max-width: 160px;
}

.finished-inventory-stats {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.finished-inventory-ledger-card {
  padding-bottom: 12px;
}

.finished-col-time { width: 112px; }
.finished-col-customer { width: 88px; }
.finished-col-model { width: 88px; }
.finished-col-color { width: 82px; }
.finished-col-spec { width: 110px; }
.finished-col-wall { width: 58px; }
.finished-col-lock { width: 64px; }
.finished-col-leg { width: 58px; }
.finished-col-qty { width: 78px; }
.finished-col-warehouse { width: 80px; }
.finished-col-remark { width: 162px; }

.movement-ledger-card {
  padding: 10px 12px;
}

.movement-ledger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.movement-ledger-filter {
  align-items: end;
  gap: 6px;
  padding-top: 6px;
}

.movement-ledger-filter label {
  min-width: 92px;
}

.movement-ledger-filter input,
.movement-ledger-filter select {
  min-width: 0;
  height: 30px;
  border-radius: 4px;
  font-size: 12px;
  padding: 4px 7px;
}

.movement-ledger-filter .field-label {
  margin-bottom: 2px;
  font-size: 11px;
}

.movement-ledger-filter .toolbar-actions {
  gap: 6px;
}

.movement-ledger-filter button,
.movement-ledger-actions button {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.movement-ledger-table-wrap {
  border: 1px solid #b8c0cc;
  background: #fff;
}

.movement-ledger-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
  border-collapse: collapse;
  border-radius: 0;
  font-size: 11.5px;
}

.movement-ledger-table th,
.movement-ledger-table td {
  padding: 4px 6px;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid #c5ccd6;
  line-height: 1.28;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movement-ledger-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef1f5;
  color: #253040;
  text-align: center;
  font-weight: 700;
}

.movement-ledger-table tbody tr:nth-child(even) td {
  background: #f6fbff;
}

.movement-ledger-table tbody tr:hover td {
  background: #eaf4ff;
}

.movement-ledger-table .center {
  text-align: center;
}

.movement-ledger-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.movement-direction-tag {
  display: inline-block;
  max-width: 100%;
  min-width: 44px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  border: 1px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-direction-in {
  color: #17633a;
  background: #e7f6ed;
  border-color: #9ed9b9;
}

.movement-direction-out {
  color: #9f2323;
  background: #fdeaea;
  border-color: #efb0b0;
}

.movement-direction-reverse {
  color: #9a5a00;
  background: #fff3d8;
  border-color: #efc36c;
}

.movement-direction-neutral {
  color: #4f5a67;
  background: #eef2f6;
  border-color: #cbd3de;
}

.movement-customer-order,
.movement-ledger-remark {
  max-width: 150px;
}

.movement-detail-button {
  padding: 0;
  font-size: 11px;
}

.movement-detail-grid .record-field strong {
  word-break: break-all;
}

.movement-col-time { width: 78px; }
.movement-col-category { width: 50px; }
.movement-col-type { width: 92px; }
.movement-col-item { width: 90px; }
.movement-col-spec { width: 104px; }
.movement-col-lock { width: 50px; }
.movement-col-qty { width: 64px; }
.movement-col-balance { width: 64px; }
.movement-col-warehouse { width: 64px; }
.movement-col-customer { width: 92px; }
.movement-col-operator { width: 62px; }
.movement-col-note { width: 126px; }
.movement-col-action { width: 44px; }

.raw-material-page {
  gap: 12px;
}

.raw-material-stats {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.raw-material-section {
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.raw-section-heading,
.raw-subpanel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.raw-section-heading h3,
.raw-subpanel h4,
.raw-subpanel-title h4 {
  margin: 0;
  color: #0f172a;
}

.raw-section-heading .section-desc {
  max-width: 820px;
  margin-top: 4px;
}

.raw-material-filter,
.raw-material-operation-form,
.raw-material-maintenance-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  align-items: end;
}

.raw-material-filter {
  grid-template-columns: minmax(220px, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;
  margin-bottom: 10px;
}

.raw-material-filter input,
.raw-material-filter select,
.raw-material-operation-form input,
.raw-material-operation-form select,
.raw-material-maintenance-form input,
.raw-material-maintenance-form select {
  min-width: 0;
}

.raw-material-table-wrap,
.raw-bom-table-wrap {
  background: #fff;
}

.raw-material-table {
  min-width: 1120px;
  font-size: 12px;
}

.raw-material-table th,
.raw-material-table td,
.raw-bom-table th,
.raw-bom-table td {
  padding: 5px 7px;
  white-space: nowrap;
  vertical-align: middle;
}

.raw-material-table th,
.raw-bom-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.raw-material-table .number-cell {
  text-align: right;
}

.raw-material-table-row.raw-material-alert-low td {
  background: #fff7ed;
}

.raw-material-table-row.raw-material-alert-high td {
  background: #fefce8;
}

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

.raw-subpanel {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}

.raw-subpanel h4 {
  margin-bottom: 8px;
  font-size: 15px;
}

.raw-material-operation-form {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.raw-material-maintenance-form {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.raw-material-operation-form .span-2,
.raw-material-maintenance-form .span-2 {
  grid-column: span 2;
}

.raw-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  grid-column: 1 / -1;
}

.raw-compact-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-height: 180px;
  overflow: auto;
}

.raw-compact-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
}

.raw-bom-table {
  min-width: 680px;
  font-size: 12px;
}

.raw-material-import-form .inventory-import-actions {
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .raw-material-stats,
  .raw-operation-grid,
  .raw-bom-grid {
    grid-template-columns: 1fr;
  }

  .raw-material-filter,
  .raw-material-operation-form,
  .raw-material-maintenance-form {
    grid-template-columns: 1fr;
  }

  .raw-material-operation-form .span-2,
  .raw-material-maintenance-form .span-2 {
    grid-column: auto;
  }
}

.raw-ledger-page {
  display: grid;
  gap: 10px;
}

.raw-ledger-toolbar,
.raw-ledger-main,
.raw-ledger-panel,
.raw-ledger-bom,
.raw-ledger-import {
  background: #fff;
  border: 1px solid #cfd8e3;
}

.raw-ledger-toolbar {
  padding: 8px;
}

.raw-ledger-filter {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(130px, 1fr) minmax(130px, 1fr) repeat(5, auto);
  gap: 6px;
  align-items: end;
}

.raw-ledger-filter label,
.raw-ledger-inline-form label,
.raw-ledger-form label,
.raw-ledger-import-form label {
  margin: 0;
}

.raw-ledger-filter input,
.raw-ledger-filter select,
.raw-ledger-inline-form input,
.raw-ledger-inline-form select,
.raw-ledger-form input,
.raw-ledger-form select {
  min-width: 0;
}

.raw-ledger-table-head,
.raw-ledger-panel-head,
.raw-ledger-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #0f172a;
}

.raw-ledger-table-head span,
.raw-ledger-panel-head span,
.raw-ledger-section-title span {
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
}

.raw-ledger-table {
  min-width: 1120px;
  font-size: 12px;
}

.raw-ledger-table th,
.raw-ledger-table td,
.raw-ledger-bom-table th,
.raw-ledger-bom-table td {
  padding: 4px 6px;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid #e5eaf0;
}

.raw-ledger-table th,
.raw-ledger-bom-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f7;
}

.raw-ledger-table .number-cell {
  text-align: right;
}

.raw-ledger-row {
  cursor: pointer;
}

.raw-ledger-row:hover td {
  background: #f1f5f9;
}

.raw-ledger-row.is-selected td {
  background: #e0f2fe;
}

.raw-ledger-row.is-editing td {
  background: #fef3c7;
}

.raw-ledger-row.is-inline-editing td {
  background: #fff7d6;
}

.raw-ledger-row.is-saved td {
  animation: raw-ledger-saved-flash 1.2s ease-out;
}

@keyframes raw-ledger-saved-flash {
  from { background: #bbf7d0; }
  to { background: transparent; }
}

.raw-ledger-row input {
  width: 100%;
  min-width: 54px;
  height: 24px;
  margin: 0;
  padding: 2px 4px;
  border: 1px solid #b6c2d2;
  border-radius: 3px;
  background: #fff;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 18px;
}

.raw-inline-actions {
  display: flex;
  gap: 4px;
}

.raw-inline-actions .edit-btn {
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #94a3b8;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  line-height: 18px;
}

.raw-inline-actions .edit-btn.save {
  background: #0f3b6d;
  border-color: #0f3b6d;
  color: #fff;
}

.raw-inline-actions .edit-btn.cancel {
  background: #fff;
  color: #475569;
}

.raw-selected-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f9fafb;
  font-size: 13px;
}

.raw-selected-summary.is-empty {
  color: #64748b;
}

.raw-panel-tabs {
  display: flex;
  gap: 0;
  padding: 8px 10px 0;
  border-bottom: 1px solid #dbe3ee;
}

.raw-panel-tabs button {
  min-height: 30px;
  padding: 5px 14px;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
}

.raw-panel-tabs button.active {
  background: #fff;
  color: #0f3b6d;
  font-weight: 700;
}

.raw-ledger-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
  padding: 10px;
  align-items: end;
}

.raw-ledger-form-short {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.raw-ledger-form .wide {
  grid-column: span 2;
}

.raw-ledger-form-actions {
  display: flex;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.raw-ledger-bom-forms {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.raw-ledger-inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.raw-ledger-inline-form#bomForm {
  grid-template-columns: repeat(6, minmax(100px, 1fr)) auto;
}

.raw-ledger-bom-table {
  min-width: 760px;
  font-size: 12px;
}

.bom-settings-v1 {
  border-top: 1px solid #dbe3ee;
}

.bom-settings-selector {
  display: grid;
  grid-template-columns: 150px 1.2fr 1.2fr 1.5fr minmax(210px, auto);
  gap: 8px;
  align-items: end;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.bom-step-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  padding: 10px 10px 0;
}

.bom-step-title strong {
  color: #1f2937;
  font-size: 15px;
}

.bom-step-title span {
  color: #64748b;
  font-size: 13px;
}

.bom-step-title-inline {
  padding: 0 0 8px;
}

.bom-model-save {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bom-model-save span {
  max-width: 320px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.bom-settings-selector label,
.bom-settings-form label {
  margin: 0;
}

.bom-settings-selector input,
.bom-settings-selector select,
.bom-settings-table input,
.bom-settings-table select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #fff;
  font-size: 13px;
}

.bom-settings-form {
  padding: 10px;
}

.bom-settings-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bom-settings-head strong {
  display: block;
  color: #1f2937;
  font-size: 15px;
}

.bom-settings-head span {
  color: #64748b;
  font-size: 13px;
}

.bom-settings-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

.bom-settings-table th,
.bom-settings-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.35;
  vertical-align: middle;
}

.bom-settings-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.bom-settings-table td:last-child,
.bom-settings-table th:last-child {
  text-align: right;
  width: 70px;
}

.bom-settings-table td:nth-child(4) {
  width: 120px;
}

.bom-settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.raw-ledger-import {
  padding-bottom: 8px;
}

.raw-ledger-import-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 10px;
}

@media (max-width: 980px), (pointer: coarse) and (hover: none) {
  .raw-ledger-filter,
  .raw-ledger-form,
  .raw-ledger-form-short,
  .raw-ledger-inline-form,
  .raw-ledger-inline-form#bomForm {
    grid-template-columns: 1fr;
  }

  .raw-ledger-form .wide {
    grid-column: auto;
  }

  .bom-settings-selector {
    grid-template-columns: 1fr;
  }
}

.raw-document-section {
  padding: 10px 0 0;
  border-top: 1px solid #dbe3ee;
}

.raw-document-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.raw-document-toolbar .btn.active {
  background: #0f3b6d;
  border-color: #0f3b6d;
  color: #fff;
}

.raw-document-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.raw-document-table th,
.raw-document-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.35;
  vertical-align: middle;
}

.raw-document-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.raw-document-table td:last-child,
.raw-document-table th:last-child {
  text-align: right;
}

.raw-document-empty {
  padding: 12px;
  color: #64748b;
  text-align: center;
}

.raw-document-form,
.raw-document-detail {
  margin: 10px;
  padding: 10px;
  border: 1px solid #d9e2ec;
  background: #fbfdff;
}

.raw-document-form h4,
.raw-document-detail h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #1f2937;
}

.raw-document-form-head,
.raw-document-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #334155;
  font-size: 13px;
}

.raw-document-form-head strong,
.raw-document-detail-head strong {
  color: #1f2937;
  font-size: 15px;
}

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

.raw-document-lines {
  margin-top: 12px;
  overflow-x: auto;
}

.raw-document-lines table {
  min-width: 980px;
}

.raw-document-lines select,
.raw-document-lines input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #fff;
  font-size: 13px;
}

.raw-document-actions,
.raw-document-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 980px), (pointer: coarse) and (hover: none) {
  .raw-document-fields,
  .raw-document-detail-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 560px) {
  .raw-document-fields,
  .raw-document-detail-grid {
    grid-template-columns: 1fr;
  }

  .raw-document-table th,
  .raw-document-table td {
    padding: 6px;
  }
}

.shipment-workbench {
  display: grid;
  gap: 12px;
}

.shipment-panel {
  background: #fff;
  border: 1px solid #d7dfe8;
  border-radius: 6px;
  padding: 12px;
}

.shipment-ready-filter,
.shipment-history-filter {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.shipment-ready-filter label,
.shipment-history-filter label,
.shipment-document-header label {
  display: grid;
  gap: 4px;
}

.shipment-ready-filter input,
.shipment-history-filter input,
.shipment-history-filter select,
.shipment-document-header input,
.shipment-draft-table input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #fff;
  font-size: 13px;
}

.shipment-document-header {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px 10px;
  margin-bottom: 10px;
}

.shipment-document-header .wide {
  grid-column: span 2;
}

.shipment-ready-table,
.shipment-draft-table,
.shipment-history-table {
  min-width: 920px;
  font-size: 12px;
}

.shipment-ready-table th,
.shipment-ready-table td,
.shipment-draft-table th,
.shipment-draft-table td,
.shipment-history-table th,
.shipment-history-table td {
  padding: 6px 7px;
  border: 1px solid #d7dfe8;
  white-space: nowrap;
  vertical-align: middle;
}

.shipment-ready-table th,
.shipment-draft-table th,
.shipment-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f6;
}

.shipment-draft-table input[name="quantity"] {
  width: 86px;
}

.shipment-ready-table-wrap,
.shipment-draft-table-wrap,
.shipment-history-table-wrap {
  background: #fff;
}

/* ===== Finance Ledger V1 ===== */
.finance-ledger-page {
  display: grid;
  gap: 10px;
}

.finance-ledger-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #fff;
  border: 1px solid #cfd8e3;
}

.finance-ledger-summary span {
  min-width: 140px;
  padding: 8px 12px;
  border-right: 1px solid #e2e8f0;
}

.finance-ledger-summary em {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.finance-ledger-summary strong {
  display: block;
  margin-top: 2px;
  color: #0b3e6f;
  font-size: 16px;
}

.finance-ledger-panel {
  background: #fff;
  border: 1px solid #cfd8e3;
}

.finance-ledger-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.finance-ledger-section-head strong {
  display: block;
  color: #1e293b;
  font-size: 14px;
}

.finance-ledger-section-head span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.finance-ledger-table-wrap {
  background: #fff;
}

.finance-ledger-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px;
}

.finance-ledger-table th,
.finance-ledger-table td {
  padding: 5px 7px;
  border: 1px solid #d7dfe8;
  white-space: nowrap;
  vertical-align: middle;
}

.finance-ledger-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  text-align: center;
}

.finance-ledger-table tbody tr:hover td {
  background: #f8fafc;
}

.finance-ledger-table tr.is-selected td {
  background: #e0f2fe;
}

.finance-ledger-table .center {
  text-align: center;
}

.finance-ledger-table .number-cell {
  text-align: right;
}

.finance-line-table {
  min-width: 860px;
}

.finance-ledger-table input,
.finance-ledger-fields input,
.finance-ledger-fields select {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
}

.finance-money-input {
  max-width: 92px;
  text-align: right;
}

.finance-ledger-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e2e8f0;
  background: #fbfdff;
}

.finance-ledger-fields label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.finance-ledger-fields .wide {
  grid-column: span 2;
}

.finance-ledger-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 10px 10px;
  background: #fbfdff;
}

.finance-ledger-empty {
  padding: 14px;
}

@media (max-width: 980px), (pointer: coarse) and (hover: none) {
  .finance-ledger-fields {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .finance-ledger-fields .wide {
    grid-column: 1 / -1;
  }
}

.shipment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 980px), (pointer: coarse) and (hover: none) {
  .shipment-ready-filter,
  .shipment-history-filter,
  .shipment-document-header {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .shipment-ready-filter .toolbar-actions,
  .shipment-history-filter .toolbar-actions,
  .shipment-document-header .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .shipment-ready-filter,
  .shipment-history-filter,
  .shipment-document-header {
    grid-template-columns: 1fr;
  }
}

/* ===== Compact ledger tables V1 ===== */
:root {
  --ledger-head-bg: #eef3f8;
  --ledger-row-alt: #f6faff;
  --ledger-row-hover: #eaf4ff;
  --ledger-cell-border: #cfd8e3;
  --ledger-cell-border-soft: #dbe3ee;
}

.content-area {
  gap: 12px;
}

.topbar {
  padding: 16px 20px;
}

.topbar h1 {
  margin-bottom: 6px;
}

.page-view {
  gap: 12px;
  padding: 16px 20px 20px;
}

.page-stack,
.form-stack,
.form-card,
.detail-card,
.list-card {
  gap: 10px;
}

.list-card,
.form-card,
.detail-card {
  padding: 14px;
  border-radius: 12px;
}

.section-heading {
  gap: 10px;
}

.section-heading.compact h3,
.section-heading h2,
.section-heading h3 {
  margin-bottom: 4px;
}

.section-desc,
.record-meta,
.data-meta {
  line-height: 1.42;
}

.toolbar,
.toolbar .toolbar-actions,
.action-row {
  gap: 8px;
}

.page-view input,
.page-view select {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.page-view textarea {
  min-height: 74px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.page-view .primary-button,
.page-view .secondary-button,
.page-view .ghost-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
}

.metric-card,
.stat-card,
.feature-card,
.tip-card,
.help-card {
  padding: 14px;
  border-radius: 12px;
}

.metric-card strong,
.stat-card strong {
  margin-top: 6px;
  font-size: 22px;
}

.raw-material-page,
.raw-ledger-page,
.shipment-workbench,
.finance-ledger-page {
  gap: 8px;
}

.raw-material-section,
.shipment-panel,
.finance-ledger-panel,
.raw-ledger-toolbar,
.raw-ledger-main,
.raw-ledger-panel,
.raw-ledger-bom,
.raw-ledger-import {
  border-color: var(--ledger-cell-border);
}

.raw-material-section,
.shipment-panel {
  padding: 10px;
  border-radius: 4px;
}

.raw-section-heading,
.raw-subpanel-title,
.finance-ledger-section-head {
  margin-bottom: 8px;
}

.raw-ledger-table-head,
.raw-ledger-panel-head,
.raw-ledger-section-title,
.finance-ledger-section-head {
  padding: 6px 8px;
}

.page-view [class*="table-wrap"],
.page-view .raw-document-lines {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-color: var(--ledger-cell-border);
  border-radius: 4px;
  background: #fff;
}

.page-view table:not(.print-table):not(.sale-table):not(.sale-meta),
.modal-panel:not(.print-sheet) table:not(.print-table):not(.sale-table):not(.sale-meta) {
  border-collapse: collapse;
  border-spacing: 0;
  border-radius: 0;
  overflow: visible;
  background: #fff;
  font-size: 12px;
  line-height: 1.32;
}

.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) th,
.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) td,
.modal-panel:not(.print-sheet) table:not(.print-table):not(.sale-table):not(.sale-meta) th,
.modal-panel:not(.print-sheet) table:not(.print-table):not(.sale-table):not(.sale-meta) td {
  padding: 4px 6px;
  border: 1px solid var(--ledger-cell-border-soft);
  line-height: 1.32;
  vertical-align: middle;
}

.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) thead th,
.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) > tbody > tr:first-child > th,
.modal-panel:not(.print-sheet) table:not(.print-table):not(.sale-table):not(.sale-meta) thead th {
  background: var(--ledger-head-bg);
  color: #263646;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) tbody tr:nth-child(even):not(.order-date-head):not(.order-customer-head):not(.factory-customer-group-row):not(.import-error-row):not(.raw-material-alert-low):not(.raw-material-alert-high):not(.is-selected):not(.is-editing):not(.is-inline-editing):not(.order-ledger-edit-row):not(.is-just-edited) > td,
.modal-panel:not(.print-sheet) table:not(.print-table):not(.sale-table):not(.sale-meta) tbody tr:nth-child(even):not(.import-error-row):not(.is-selected):not(.is-editing):not(.is-inline-editing) > td {
  background: var(--ledger-row-alt);
}

.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) tbody tr:not(.order-date-head):not(.order-customer-head):not(.factory-customer-group-row):not(.is-selected):not(.is-editing):not(.is-inline-editing):not(.order-ledger-edit-row):hover > td,
.modal-panel:not(.print-sheet) table:not(.print-table):not(.sale-table):not(.sale-meta) tbody tr:not(.is-selected):not(.is-editing):not(.is-inline-editing):hover > td {
  background: var(--ledger-row-hover);
}

.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) .status-pill,
.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) .alert-pill {
  min-height: 20px;
  padding: 2px 6px;
  font-size: 11px;
}

.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) button,
.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) .primary-button,
.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) .secondary-button,
.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) .ghost-button,
.page-view table:not(.print-table):not(.sale-table):not(.sale-meta) .text-button {
  min-height: 24px;
  height: auto;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.2;
}

.order-ledger-polished th,
.order-ledger-polished td {
  height: 28px;
}

.order-ledger-edit-row input,
.raw-ledger-row input,
.finance-ledger-table input,
.shipment-draft-table input,
.bom-settings-table input,
.bom-settings-table select,
.raw-document-lines select,
.raw-document-lines input {
  height: 24px;
  min-height: 24px;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
}

.finished-inventory-table,
.movement-ledger-table,
.movement-table,
.order-ledger-table,
.raw-material-table,
.raw-bom-table,
.raw-ledger-table,
.raw-ledger-bom-table,
.raw-document-table,
table.raw-document-lines,
.shipment-ready-table,
.shipment-draft-table,
.shipment-history-table,
.finance-ledger-table,
.bom-settings-table,
.import-preview-table {
  font-size: 12px;
}

.movement-table,
.order-ledger-table {
  min-width: 900px;
}

.raw-document-table,
table.raw-document-lines,
.import-preview-table {
  min-width: 820px;
}

.shipment-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.shipment-withdraw-disabled {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  color: #8a5a00;
  font-size: 12px;
  line-height: 1.35;
}

.danger-text-button {
  color: #b42318;
}

.is-withdrawn-shipment {
  background: #fff6f4;
}

.home-dashboard-v1 .metrics-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.home-dashboard-v1 .metric-card {
  min-height: 0;
  padding: 12px 14px;
}

.home-dashboard-v1 .metric-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.home-dashboard-v1 .metric-card-action {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.home-dashboard-v1 .metric-card-action:hover {
  transform: translateY(-1px);
  border-color: rgba(11, 62, 111, 0.28);
  box-shadow: 0 10px 20px rgba(11, 62, 111, 0.06);
  background: #fcfdff;
}

.home-ledger-stack {
  display: grid;
  gap: 12px;
}

.home-ledger-section {
  padding: 16px 18px;
}

.home-dashboard-section .section-desc {
  max-width: 680px;
}

.home-dashboard-button {
  white-space: nowrap;
  min-height: 34px;
  padding: 0 14px;
}

.home-ledger-table {
  border-top: 1px solid #e9eef4;
}

.home-ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.95fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #eef2f6;
}

.home-ledger-row:last-child {
  border-bottom: none;
}

.home-ledger-main,
.home-ledger-value {
  min-width: 0;
}

.home-ledger-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0b3e6f;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.home-ledger-meta {
  margin-top: 4px;
  color: #667688;
  font-size: 13px;
  line-height: 1.5;
}

.home-ledger-value {
  color: #24364a;
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.home-ledger-action {
  display: flex;
  justify-content: flex-end;
}

.home-ledger-empty {
  padding: 10px 0 2px;
  color: #7b8794;
  font-size: 13px;
  line-height: 1.5;
}

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

  .home-ledger-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-ledger-value {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (max-width: 720px) {
  #tasksView .production-task-table-shell {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .home-dashboard-v1 .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-ledger-section {
    padding: 14px;
  }

  .home-ledger-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
  }

  .home-ledger-value,
  .home-ledger-action {
    text-align: left;
    justify-content: flex-start;
  }

  .page-view {
    padding: 14px;
  }

  .list-card,
  .form-card,
  .detail-card {
    padding: 12px;
  }

  .page-view [class*="table-wrap"],
  .page-view .raw-document-lines {
    overflow-x: auto;
  }
}

.mobile-sidebar-bar,
.mobile-task-filter-compact,
.production-mobile-card-list,
.production-inbound-mobile-list,
.today-inbound-mobile-list {
  display: none;
}

#tasksView .quality-complete-button,
#tasksView .production-mobile-primary-action.quality-complete-button {
  font-weight: 800;
}

#tasksView .production-mobile-task-card .record-field.full,
#tasksView .today-inbound-mobile-card .record-field.full {
  grid-column: 1 / -1;
}

#tasksView .production-mobile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

#tasksView .production-mobile-order-line,
#tasksView .production-mobile-meta-line,
#tasksView .production-mobile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}

#tasksView .production-mobile-order-line strong {
  font-size: 14px;
  line-height: 1.2;
}

#tasksView .production-mobile-order-line span,
#tasksView .production-mobile-meta-line span,
#tasksView .production-mobile-stats span,
#tasksView .production-mobile-remark {
  color: #5b6b7d;
  font-size: 12px;
  line-height: 1.35;
}

#tasksView .production-mobile-main {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#tasksView .production-mobile-sub {
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

#tasksView .production-mobile-remark {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tasksView .production-mobile-actions,
#tasksView .production-inbound-mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#tasksView .production-inbound-mobile-select,
#tasksView .production-inbound-mobile-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#tasksView .production-mobile-primary-action,
#tasksView .production-mobile-secondary-action {
  min-height: 40px;
}

@media (max-width: 980px), (pointer: coarse) and (hover: none) {
  .dashboard-shell {
    padding: 12px;
    gap: 12px;
    grid-template-columns: 1fr;
    position: relative;
  }

  .dashboard-shell.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 35, 0.38);
    z-index: 55;
  }

  .content-area {
    order: 1;
    padding-right: 0;
  }

  .sidebar {
    display: none;
    order: 2;
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    height: auto;
    max-height: calc(100vh - 24px);
    z-index: 60;
    overflow: auto;
    padding: 18px;
    box-shadow: 0 26px 48px rgba(12, 40, 74, 0.22);
  }

  .dashboard-shell.sidebar-open .sidebar {
    display: flex;
  }

  .mobile-sidebar-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fc 100%);
  }

  .mobile-sidebar-toggle {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #bfd2e6;
    background: #fff;
    font-weight: 700;
  }

  .mobile-sidebar-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border: 1px solid rgba(199, 212, 224, 0.9);
    background: rgba(244, 246, 248, 0.96);
    backdrop-filter: blur(8px);
  }

  .topbar-user-card,
  .topbar-logout-button {
    display: none;
  }

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

  .nav-item {
    min-height: 44px;
    padding: 10px 12px;
    text-align: center;
  }

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

.dashboard-shell.mobile-layout {
  padding: 12px;
  gap: 12px;
  grid-template-columns: 1fr;
  position: relative;
}

.dashboard-shell.mobile-layout .content-area {
  order: 1;
  width: 100%;
  min-width: 0;
  height: auto;
  overflow: visible;
  padding-right: 0;
}

.dashboard-shell.mobile-layout .sidebar {
  display: none;
  order: 2;
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  width: auto;
  max-width: none;
  height: auto;
  max-height: calc(100vh - 24px);
  z-index: 60;
  overflow: auto;
  padding: 18px;
  box-shadow: 0 26px 48px rgba(12, 40, 74, 0.22);
}

.dashboard-shell.mobile-layout.sidebar-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 35, 0.38);
  z-index: 55;
}

.dashboard-shell.mobile-layout.sidebar-open .sidebar {
  display: flex;
}

.dashboard-shell.mobile-layout .mobile-sidebar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-shell.mobile-layout .topbar-user-card,
.dashboard-shell.mobile-layout .topbar-logout-button {
  display: none;
}

@media (max-width: 720px) {
  #tasksView .mobile-task-filter-compact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    background: #f8fbff;
  }

  #tasksView .mobile-task-filter-summary {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  #tasksView .mobile-task-filter-summary strong,
  #tasksView .mobile-task-filter-summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tasksView .mobile-task-filter-summary strong {
    font-size: 13px;
    line-height: 1.2;
  }

  #tasksView .mobile-task-filter-summary span {
    color: #5b6b7d;
    font-size: 12px;
    line-height: 1.3;
  }

  #tasksView .mobile-task-filter-toggle {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  #tasksView .mobile-task-filter-shell.is-collapsed .mobile-task-filter-form {
    display: none;
  }

  #tasksView .mobile-task-filter-form {
    margin-bottom: 10px;
  }

  .modal-root {
    padding: 10px;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 20px;
  }

  .modal-panel input,
  .modal-panel select,
  .modal-panel textarea {
    font-size: 16px;
  }

  #tasksView .production-task-page.has-mobile-task-cards .production-mobile-card-list {
    display: grid;
    gap: 8px;
  }

  #tasksView .production-task-page.has-mobile-task-cards .production-task-table-shell {
    display: none;
  }

  #tasksView .production-task-page.has-mobile-inbound-cards .production-inbound-mobile-list {
    display: grid;
    gap: 8px;
  }

  #tasksView .production-task-page.has-mobile-inbound-cards .production-task-table-shell {
    display: none;
  }

  #tasksView .production-mobile-task-card {
    padding: 10px 12px;
    gap: 6px;
    border-radius: 14px;
  }

  #tasksView .production-inbound-mobile-card,
  #tasksView .today-inbound-mobile-card {
    padding: 10px 12px;
    gap: 6px;
    border-radius: 14px;
  }

  #tasksView .production-mobile-primary-action,
  #tasksView .production-mobile-secondary-action {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  #tasksView .quality-complete-button {
    min-width: 88px;
  }

  #tasksView .production-task-action-button {
    min-height: 34px;
    height: auto;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.2;
  }

  #tasksView .production-task-table-shell.is-inbound-task-table {
    border: 1px solid #dbe3ec;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
  }

  #tasksView .task-col-action {
    width: 176px;
  }

  #tasksView .production-task-fixed-head th:first-child,
  #tasksView .production-task-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    box-shadow: 10px 0 18px rgba(12, 40, 74, 0.08);
  }

  #tasksView .production-task-fixed-head th:first-child {
    z-index: 6;
  }

  #tasksView .legacy-order-actions {
    min-width: 176px;
  }

  #tasksView .production-task-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
  }

  #tasksView .inbound-batch-check {
    width: 28px;
    height: 28px;
  }

  #tasksView .inbound-force-batch-editor {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 6px 8px;
  }

  #tasksView .inbound-force-batch-editor input {
    width: 48px;
    height: 26px;
    font-size: 12px;
  }

  #tasksView .today-inbound-table-wrap {
    display: none;
  }

  #tasksView .today-inbound-mobile-list {
    display: grid;
    gap: 8px;
  }

  #tasksView .inbound-batch-bar {
    position: sticky;
    bottom: 10px;
    z-index: 18;
    margin-top: 8px;
    padding: 8px 10px;
    border-left-width: 1px;
    border-top: 4px solid #22c55e;
    box-shadow: var(--shadow-sm);
  }

  #tasksView .inbound-batch-summary {
    width: 100%;
    white-space: normal;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 12px;
  }

  #tasksView .inbound-batch-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  #tasksView .inbound-batch-button {
    flex: 1 1 110px;
    min-height: 34px;
    height: auto;
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ===== Real phone density V1.3 ===== */
body.real-phone-layout .dashboard-shell.mobile-layout {
  padding: 8px;
  gap: 8px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .content-area {
  gap: 8px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .sidebar {
  top: 8px;
  left: 8px;
  right: 8px;
  max-height: calc(100vh - 16px);
  padding: 14px 12px 12px;
  border-radius: 14px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .topbar {
  padding: 10px 12px;
  gap: 8px;
  border-radius: 14px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .topbar h1 {
  margin-bottom: 2px;
  font-size: clamp(20px, 5vw, 24px);
  line-height: 1.12;
}

body.real-phone-layout .dashboard-shell.mobile-layout .page-view {
  padding: 10px 12px 12px;
  gap: 8px;
  border-radius: 14px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .detail-card,
body.real-phone-layout .dashboard-shell.mobile-layout .list-card,
body.real-phone-layout .dashboard-shell.mobile-layout .form-card {
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .section-kicker,
body.real-phone-layout .dashboard-shell.mobile-layout .brand-kicker {
  margin-bottom: 3px;
  font-size: 10px;
  letter-spacing: 0.1em;
}

body.real-phone-layout .dashboard-shell.mobile-layout .section-desc,
body.real-phone-layout .dashboard-shell.mobile-layout .record-meta,
body.real-phone-layout .dashboard-shell.mobile-layout .data-meta {
  font-size: 11px;
  line-height: 1.35;
}

body.real-phone-layout .dashboard-shell.mobile-layout .section-heading {
  gap: 8px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .section-heading.compact h3,
body.real-phone-layout .dashboard-shell.mobile-layout .section-heading h2,
body.real-phone-layout .dashboard-shell.mobile-layout .section-heading h3 {
  margin-bottom: 2px;
  line-height: 1.18;
}

body.real-phone-layout .dashboard-shell.mobile-layout .mobile-sidebar-bar {
  margin-top: 8px;
  padding: 8px 10px;
  gap: 8px;
  border-radius: 12px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .mobile-sidebar-toggle {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .mobile-sidebar-hint {
  font-size: 11px;
  line-height: 1.25;
}

body.real-phone-layout .dashboard-shell.mobile-layout .page-view input,
body.real-phone-layout .dashboard-shell.mobile-layout .page-view select {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .page-view textarea {
  min-height: 70px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

body.real-phone-layout .dashboard-shell.mobile-layout .page-view .primary-button,
body.real-phone-layout .dashboard-shell.mobile-layout .page-view .secondary-button,
body.real-phone-layout .dashboard-shell.mobile-layout .page-view .ghost-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
}

body.real-phone-layout .home-dashboard-v1 .metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body.real-phone-layout .home-dashboard-v1 .metric-card {
  padding: 8px 9px;
  border-radius: 10px;
}

body.real-phone-layout .home-dashboard-v1 .metric-card strong {
  margin-top: 3px;
  font-size: 18px;
}

body.real-phone-layout .home-dashboard-v1 .metric-card .data-meta {
  font-size: 10px;
  line-height: 1.25;
}

body.real-phone-layout .home-ledger-stack {
  gap: 8px;
}

body.real-phone-layout .home-ledger-section {
  padding: 10px 12px;
}

body.real-phone-layout .home-ledger-row {
  gap: 6px;
  padding: 8px 0;
}

body.real-phone-layout .home-ledger-title {
  gap: 6px;
  font-size: 13px;
  line-height: 1.3;
}

body.real-phone-layout .home-ledger-meta,
body.real-phone-layout .home-ledger-value,
body.real-phone-layout .home-ledger-empty {
  font-size: 11px;
  line-height: 1.35;
}

body.real-phone-layout #tasksView .production-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px 0 2px;
}

body.real-phone-layout #tasksView .process-overview-button {
  min-height: 52px;
  padding: 7px 10px;
  border-radius: 12px;
  justify-content: space-between;
}

body.real-phone-layout #tasksView .process-overview-button strong {
  font-size: 13px;
}

body.real-phone-layout #tasksView .process-overview-button span {
  font-size: 11px;
}

body.real-phone-layout #tasksView .mobile-task-filter-compact {
  margin-bottom: 8px;
  padding: 8px 10px;
  gap: 8px;
  border-radius: 12px;
}

body.real-phone-layout #tasksView .mobile-task-filter-summary {
  gap: 2px;
}

body.real-phone-layout #tasksView .mobile-task-filter-summary strong {
  font-size: 12px;
}

body.real-phone-layout #tasksView .mobile-task-filter-summary span {
  font-size: 11px;
}

body.real-phone-layout #tasksView .mobile-task-filter-toggle {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

body.real-phone-layout #tasksView .production-task-summary {
  gap: 6px;
  padding: 6px 8px;
  font-size: 11px;
}

body.real-phone-layout #tasksView .production-task-summary strong {
  font-size: 12px;
}

body.real-phone-layout #tasksView .production-task-page.has-mobile-task-cards .production-mobile-card-list,
body.real-phone-layout #tasksView .production-task-page.has-mobile-inbound-cards .production-inbound-mobile-list,
body.real-phone-layout #tasksView .today-inbound-mobile-list {
  gap: 6px;
}

body.real-phone-layout #tasksView .production-mobile-task-card,
body.real-phone-layout #tasksView .production-inbound-mobile-card,
body.real-phone-layout #tasksView .today-inbound-mobile-card,
body.real-phone-layout #tasksView .compact-ready-inbound .record-card,
body.real-phone-layout #tasksView .inbound-order-card {
  gap: 5px;
  padding: 8px 10px;
  border-radius: 12px;
}

body.real-phone-layout #tasksView .production-mobile-order-line strong,
body.real-phone-layout #tasksView .record-title {
  font-size: 13px;
}

body.real-phone-layout #tasksView .production-mobile-order-line span,
body.real-phone-layout #tasksView .production-mobile-meta-line span,
body.real-phone-layout #tasksView .production-mobile-stats span,
body.real-phone-layout #tasksView .production-mobile-sub,
body.real-phone-layout #tasksView .production-mobile-remark {
  font-size: 11px;
  line-height: 1.3;
}

body.real-phone-layout #tasksView .production-mobile-main {
  font-size: 12.5px;
  line-height: 1.3;
}

body.real-phone-layout #tasksView .production-mobile-actions,
body.real-phone-layout #tasksView .production-inbound-mobile-actions,
body.real-phone-layout #tasksView .action-row {
  gap: 6px;
}

body.real-phone-layout #tasksView .production-mobile-primary-action,
body.real-phone-layout #tasksView .production-mobile-secondary-action,
body.real-phone-layout #tasksView .production-task-action-button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

body.real-phone-layout #tasksView .inbound-batch-bar {
  bottom: 6px;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 8px;
  border-left-width: 1px;
  border-top-width: 3px;
  border-radius: 12px;
}

body.real-phone-layout #tasksView .inbound-batch-bar > .inbound-batch-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.real-phone-layout #tasksView .inbound-batch-summary {
  width: 100%;
  gap: 4px 6px;
  font-size: 11px;
}

body.real-phone-layout #tasksView .inbound-batch-summary strong {
  font-size: 12px;
}

body.real-phone-layout #tasksView .inbound-batch-button {
  min-height: 36px;
  height: auto;
  padding: 6px 8px;
  font-size: 11.5px;
  line-height: 1.25;
  white-space: normal;
}

body.real-phone-layout #tasksView .inbound-force-batch-editor {
  gap: 4px;
  padding: 4px 6px;
  font-size: 11px;
}

body.real-phone-layout #tasksView .inbound-force-batch-editor input {
  width: 44px;
  height: 24px;
  font-size: 11px;
}

.order-mobile-ledger,
.order-mobile-group,
.order-mobile-card-list {
  display: none;
}

body.real-phone-layout .order-filter-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
}

body.real-phone-layout .order-filter-toolbar label,
body.real-phone-layout .order-filter-toolbar input {
  min-width: 0;
}

body.real-phone-layout .order-filter-toolbar .toolbar-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 0;
}

body.real-phone-layout .batch-order-form-compact {
  gap: 8px;
}

body.real-phone-layout .batch-order-toolbar {
  gap: 6px;
}

body.real-phone-layout .batch-order-ledger-row {
  grid-template-columns: 24px repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px 0;
}

body.real-phone-layout .batch-order-ledger-row .batch-copy-button,
body.real-phone-layout .batch-order-ledger-row input {
  height: 30px;
}

body.real-phone-layout .order-ledger-summary {
  gap: 6px;
  margin-bottom: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 11px;
}

body.real-phone-layout .order-ledger-summary span {
  gap: 4px;
  padding-right: 8px;
}

body.real-phone-layout .order-ledger-summary strong {
  font-size: 12px;
}

body.real-phone-layout .order-ledger-host .order-mobile-ledger {
  display: grid;
  gap: 8px;
}

body.real-phone-layout .order-ledger-host .order-mobile-group {
  display: grid;
  gap: 6px;
}

body.real-phone-layout .order-ledger-host .order-mobile-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  color: #536273;
  font-size: 11px;
  line-height: 1.3;
}

body.real-phone-layout .order-ledger-host .order-mobile-group-head strong {
  color: #0b3e6f;
  font-size: 12px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-list {
  display: grid;
  gap: 6px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card {
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card .record-header {
  gap: 8px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card .record-title {
  font-size: 13px;
  line-height: 1.25;
}

body.real-phone-layout .order-ledger-host .order-mobile-card .record-meta {
  gap: 4px 8px;
  font-size: 11px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card .record-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card .record-field {
  padding: 8px 9px;
  border-radius: 10px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card .record-field span {
  margin-bottom: 4px;
  font-size: 10px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card .record-field strong {
  font-size: 12px;
  line-height: 1.28;
}

body.real-phone-layout .order-ledger-host .order-mobile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.real-phone-layout .order-ledger-host .order-mobile-actions .ghost-button,
body.real-phone-layout .order-ledger-host .order-mobile-actions .secondary-button {
  min-height: 36px;
  width: 100%;
}

body.real-phone-layout .order-ledger-host .order-ledger-table-wrap {
  display: none;
}

body.real-phone-layout .order-ledger-host.is-inline-editing-mobile .order-mobile-ledger {
  display: none;
}

body.real-phone-layout .order-ledger-host.is-inline-editing-mobile .order-ledger-table-wrap {
  display: block;
}

@media (max-width: 399px) {
  body.real-phone-layout .home-dashboard-v1 .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.real-phone-layout #tasksView .production-overview,
  body.real-phone-layout #tasksView .inbound-batch-bar > .inbound-batch-actions,
  body.real-phone-layout .order-ledger-host .order-mobile-actions {
    grid-template-columns: 1fr;
  }

  body.real-phone-layout .order-ledger-host .order-mobile-card .record-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Real phone density V1.4 ===== */
.home-mobile-risk-panel {
  display: none;
}

body.real-phone-layout .app-version-mark {
  right: 4px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 4px);
  z-index: 22;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  opacity: 0.58;
}

body.app-authenticated .app-version-mark {
  opacity: 0;
  pointer-events: none;
}

body.app-authenticated.app-sidebar-open .app-version-mark {
  opacity: 0.58;
  pointer-events: auto;
}

body.real-phone-layout .home-dashboard-v1 .metrics-grid {
  gap: 5px;
}

body.real-phone-layout .home-dashboard-v1 .metric-card {
  padding: 7px 8px;
  border-radius: 10px;
}

body.real-phone-layout .home-dashboard-v1 .metric-card strong {
  margin-top: 2px;
  font-size: 16px;
}

body.real-phone-layout .home-dashboard-v1 .metric-card .data-meta {
  font-size: 10px;
  line-height: 1.2;
}

body.real-phone-layout .home-ledger-stack {
  display: none;
}

body.real-phone-layout .home-mobile-risk-panel {
  display: grid;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 12px;
}

body.real-phone-layout .home-mobile-risk-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

body.real-phone-layout .home-mobile-risk-head strong {
  font-size: 13px;
  line-height: 1.2;
}

body.real-phone-layout .home-mobile-risk-head span {
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
}

body.real-phone-layout .home-mobile-risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.real-phone-layout .home-mobile-risk-item {
  display: grid;
  gap: 2px;
  align-items: start;
  min-height: 52px;
  padding: 7px 8px;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: #f8fbff;
  text-align: left;
}

body.real-phone-layout .home-mobile-risk-item strong {
  font-size: 12px;
  line-height: 1.2;
}

body.real-phone-layout .home-mobile-risk-item span {
  color: #475569;
  font-size: 10px;
  line-height: 1.2;
}

body.real-phone-layout .home-mobile-risk-item em {
  color: #0f172a;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

body.real-phone-layout .home-mobile-risk-item.is-warning {
  border-color: rgba(202, 138, 4, 0.28);
  background: #fff9e8;
}

body.real-phone-layout .home-mobile-risk-item.is-danger {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fff5f5;
}

body.real-phone-layout #tasksView .production-task-guide {
  display: none;
}

body.real-phone-layout #tasksView .production-overview {
  gap: 5px;
  padding: 2px 0 0;
}

body.real-phone-layout #tasksView .process-overview-button {
  min-height: 46px;
  padding: 6px 8px;
  border-radius: 10px;
}

body.real-phone-layout #tasksView .mobile-task-filter-compact {
  margin-bottom: 6px;
  padding: 6px 8px;
  gap: 6px;
}

body.real-phone-layout #tasksView .mobile-task-filter-summary strong {
  font-size: 11.5px;
}

body.real-phone-layout #tasksView .mobile-task-filter-summary span,
body.real-phone-layout #tasksView .production-task-summary,
body.real-phone-layout #tasksView .production-task-summary strong {
  font-size: 10.5px;
}

body.real-phone-layout #tasksView .production-task-summary {
  gap: 4px 6px;
  padding: 5px 7px;
}

body.real-phone-layout #tasksView .production-task-page.has-mobile-task-cards .production-mobile-card-list,
body.real-phone-layout #tasksView .production-task-page.has-mobile-inbound-cards .production-inbound-mobile-list,
body.real-phone-layout #tasksView .today-inbound-mobile-list {
  gap: 5px;
}

body.real-phone-layout #tasksView .production-mobile-task-card,
body.real-phone-layout #tasksView .production-inbound-mobile-card,
body.real-phone-layout #tasksView .today-inbound-mobile-card,
body.real-phone-layout #tasksView .compact-ready-inbound .record-card,
body.real-phone-layout #tasksView .inbound-order-card {
  gap: 4px;
  padding: 7px 8px;
  border-radius: 10px;
}

body.real-phone-layout #tasksView .record-title,
body.real-phone-layout #tasksView .production-mobile-order-line strong {
  font-size: 12px;
  line-height: 1.2;
}

body.real-phone-layout #tasksView .production-mobile-order-line span,
body.real-phone-layout #tasksView .production-mobile-meta-line span,
body.real-phone-layout #tasksView .production-mobile-stats span,
body.real-phone-layout #tasksView .production-mobile-sub,
body.real-phone-layout #tasksView .production-mobile-remark,
body.real-phone-layout #tasksView .record-meta {
  font-size: 10.5px;
  line-height: 1.25;
}

body.real-phone-layout #tasksView .production-mobile-main {
  font-size: 11.5px;
}

body.real-phone-layout #tasksView .production-mobile-actions,
body.real-phone-layout #tasksView .production-inbound-mobile-actions,
body.real-phone-layout #tasksView .action-row {
  gap: 5px;
}

body.real-phone-layout #tasksView .production-mobile-primary-action,
body.real-phone-layout #tasksView .production-mobile-secondary-action,
body.real-phone-layout #tasksView .production-task-action-button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 9px;
}

body.real-phone-layout #tasksView .inbound-batch-bar {
  display: grid;
  gap: 5px;
  bottom: 4px;
  margin-top: 5px;
  padding: 6px 7px;
  border-radius: 10px;
}

body.real-phone-layout #tasksView .inbound-batch-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

body.real-phone-layout #tasksView .inbound-batch-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-width: 0;
  font-size: 10.5px;
}

body.real-phone-layout #tasksView .inbound-batch-summary strong {
  font-size: 11.5px;
}

body.real-phone-layout #tasksView .inbound-batch-action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

body.real-phone-layout #tasksView .inbound-batch-button {
  min-height: 34px;
  height: auto;
  padding: 5px 6px;
  font-size: 11px;
  line-height: 1.15;
  white-space: normal;
}

body.real-phone-layout #tasksView .inbound-batch-clear-button {
  min-width: 44px;
}

body.real-phone-layout .order-ledger-summary {
  gap: 4px;
  margin-bottom: 4px;
  padding: 5px 7px;
  border-radius: 9px;
  font-size: 10px;
}

body.real-phone-layout .order-ledger-summary strong {
  font-size: 11px;
}

body.real-phone-layout .order-ledger-host .order-mobile-ledger {
  gap: 6px;
}

body.real-phone-layout .order-ledger-host .order-mobile-group {
  gap: 4px;
}

body.real-phone-layout .order-ledger-host .order-mobile-group-head {
  gap: 6px;
  padding: 0 1px;
  font-size: 10px;
}

body.real-phone-layout .order-ledger-host .order-mobile-group-head strong {
  font-size: 11px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-list {
  gap: 5px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card.order-mobile-card-v14 {
  gap: 5px;
  padding: 7px 8px;
  border-radius: 10px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-title {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-all;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-body {
  display: grid;
  gap: 3px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  font-size: 10px;
  line-height: 1.2;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-line span {
  color: #64748b;
  white-space: nowrap;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-line strong {
  color: #0f172a;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 600;
  min-width: 0;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-line.is-remark strong {
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-actions .ghost-button,
body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-actions .secondary-button {
  min-height: 32px;
  padding: 0 6px;
  width: 100%;
  border-radius: 8px;
  font-size: 11px;
}

@media (max-width: 399px) {
  body.real-phone-layout .home-mobile-risk-grid,
  body.real-phone-layout #tasksView .inbound-batch-action-row,
  body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

body.real-phone-layout .order-ledger-host .order-mobile-card-v14 .order-mobile-line {
    grid-template-columns: 48px minmax(0, 1fr);
  }
}

/* ===== Real phone density V1.5 ===== */
body.real-phone-layout .modal-root.mobile-compact-modal-root {
  place-items: end center;
  padding:
    10px
    10px
    calc(env(safe-area-inset-bottom, 0px) + 8px);
}

body.real-phone-layout .modal-panel.mobile-compact-sheet {
  width: min(100%, 480px);
  max-height: min(80vh, 820px);
  padding: 14px 14px 10px;
  gap: 12px;
  border-radius: 20px 20px 14px 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .modal-head {
  gap: 10px;
  padding-bottom: 2px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .modal-head h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .section-kicker {
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .modal-close {
  width: 34px;
  height: 34px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet form,
body.real-phone-layout .modal-panel.mobile-compact-sheet .mobile-compact-form {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 2px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet label {
  display: grid;
  gap: 5px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .field-label {
  font-size: 12px;
  line-height: 1.25;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet input,
body.real-phone-layout .modal-panel.mobile-compact-sheet select,
body.real-phone-layout .modal-panel.mobile-compact-sheet textarea {
  min-height: 40px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 10px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet textarea {
  min-height: 76px;
  padding-top: 10px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .task-complete-summary {
  padding: 10px 11px;
  border-radius: 12px;
  gap: 4px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .task-complete-choice-grid {
  gap: 8px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .lock-side-grid {
  gap: 8px;
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .modal-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 28%);
}

body.real-phone-layout .modal-panel.mobile-compact-sheet .modal-actions .primary-button,
body.real-phone-layout .modal-panel.mobile-compact-sheet .modal-actions .secondary-button,
body.real-phone-layout .modal-panel.mobile-compact-sheet .modal-actions .ghost-button {
  min-height: 40px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 10px;
}

body.real-phone-layout .toast-container {
  top: auto;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  left: 10px;
  gap: 8px;
  justify-items: stretch;
}

body.real-phone-layout .toast {
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.45;
}

#tasksView .production-mobile-task-card.is-mobile-v15-highlight,
#tasksView .production-inbound-mobile-card.is-mobile-v15-highlight,
#tasksView .today-inbound-mobile-card.is-mobile-v15-highlight,
#finishedGoodsView .inbound-order-card.is-mobile-v15-highlight,
#tasksView .compact-ready-inbound .record-card.is-mobile-v15-highlight {
  border-color: rgba(11, 62, 111, 0.38);
  background:
    linear-gradient(135deg, rgba(233, 243, 255, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow:
    0 0 0 1px rgba(11, 62, 111, 0.08),
    0 14px 28px rgba(11, 62, 111, 0.12);
}

#tasksView tr.is-mobile-v15-highlight > td {
  background: rgba(233, 243, 255, 0.92) !important;
}

@keyframes mobileV15HighlightPulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(11, 62, 111, 0.22),
      0 12px 24px rgba(11, 62, 111, 0.10);
  }

  30% {
    box-shadow:
      0 0 0 4px rgba(11, 62, 111, 0.10),
      0 14px 28px rgba(11, 62, 111, 0.12);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(11, 62, 111, 0),
      0 10px 18px rgba(11, 62, 111, 0.08);
  }
}

.is-mobile-v15-highlight {
  animation: mobileV15HighlightPulse 3s ease;
}

/* ===== Home dashboard V1.6 ===== */
.home-dashboard-v16 {
  gap: 10px;
}

.home-dashboard-v16 .home-focus-card {
  padding: 14px 16px;
}

.home-dashboard-v16 .home-focus-card .section-heading.compact {
  align-items: center;
  gap: 12px;
}

.home-dashboard-v16 .home-focus-card .section-desc {
  max-width: 760px;
  margin-bottom: 0;
}

.home-dashboard-v16 .home-focus-card .home-ledger-table {
  border-top: 1px solid #e7edf5;
}

.home-dashboard-v16 .home-focus-card .home-ledger-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.9fr) auto;
  gap: 12px;
  padding: 10px 0;
}

.home-dashboard-v16 .home-focus-card .home-ledger-title {
  font-size: 14px;
}

.home-dashboard-v16 .home-focus-card .home-ledger-meta,
.home-dashboard-v16 .home-focus-card .home-ledger-value {
  font-size: 12px;
}

.home-dashboard-v16 .home-focus-card .home-ledger-action .secondary-button,
.home-dashboard-v16 .home-focus-card .home-ledger-action .ghost-button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12px;
}

body.real-phone-layout .home-dashboard-v16 {
  gap: 8px;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card {
  padding: 10px 11px;
  border-radius: 12px;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .section-heading.compact {
  gap: 6px;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .section-heading.compact h3 {
  font-size: 14px;
  line-height: 1.2;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .section-desc {
  font-size: 10.5px;
  line-height: 1.3;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  padding: 8px 0;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-title {
  font-size: 12px;
  line-height: 1.25;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-meta,
body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-value,
body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-empty {
  font-size: 10.5px;
  line-height: 1.28;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-value {
  grid-column: 1 / -1;
  text-align: left;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-action {
  justify-content: flex-end;
}

body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-action .secondary-button,
body.real-phone-layout .home-dashboard-v16 .home-focus-card .home-ledger-action .ghost-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
}

/* ===== Mobile undo entry V1.7 ===== */
#tasksView .mobile-undo-guidance,
#finishedGoodsView .mobile-undo-guidance {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.45;
}

#tasksView .mobile-undo-button,
#finishedGoodsView .mobile-undo-button {
  border-color: rgba(180, 83, 9, 0.45);
  color: #9a3412;
  background: #fff7ed;
  font-weight: 700;
}

#tasksView .mobile-undo-disabled,
#finishedGoodsView .mobile-undo-disabled {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(107, 114, 128, 0.28);
  border-radius: 8px;
  background: #f9fafb;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
