﻿:root {
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #111827;
  --muted: #667085;
  --line: #d5dde8;
  --accent: #08796f;
  --accent-2: #2f5fbd;
  --warn: #b06a00;
  --danger: #bd2f2f;
  --ok: #2b7a41;
  --hold: #7664b8;
  --nav: #101923;
  --nav-2: #172434;
  --shadow: 0 18px 48px rgba(16, 24, 40, 0.09);
  --shadow-soft: 0 8px 22px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body.auth-locked {
  min-height: 100vh;
  overflow: hidden;
  background: #f4f7fa;
}

body.auth-locked .app-shell {
  display: none;
}

button,
input,
select {
  font: inherit;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 24px;
  background: #f4f7fa;
}

body.auth-locked .login-gate {
  display: grid;
}

.login-card {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.login-title {
  display: grid;
  gap: 6px;
  margin-bottom: 4px;
}

.login-title strong {
  font-size: 20px;
}

.login-title span,
.login-help {
  color: var(--muted);
  font-size: 14px;
}

.login-card select,
.login-card input,
.login-card button {
  width: 100%;
  min-height: 44px;
}

.login-help {
  margin-top: 4px;
  line-height: 1.6;
  text-align: center;
}

body:not(.auth-locked) .login-gate {
  display: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width, 210px) minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-width: 0;
}

.sidebar {
  position: relative;
  background: var(--nav);
  color: #f8fafc;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(8, 121, 111, 0.28);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand span {
  color: #a6b0bf;
  font-size: 11px;
  margin-top: 2px;
}

.common-system-shortcuts {
  position: relative;
  z-index: 5;
}

.common-system-shortcuts summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #405066;
  border-radius: 7px;
  color: #f8fafc;
  background: #243447;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 12px;
}

.common-system-shortcuts summary::-webkit-details-marker {
  display: none;
}

.common-system-shortcuts summary::after {
  content: "^";
  color: #dbe4ef;
  font-size: 12px;
  line-height: 1;
}

.common-system-shortcuts[open] summary::after {
  transform: rotate(0deg);
}

.common-system-shortcuts:not([open]) summary::after {
  transform: rotate(180deg);
}

.common-system-shortcuts__menu {
  position: static;
  display: grid;
  gap: 1px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #334257;
  border-radius: 8px;
  background: #0f1c2b;
  box-shadow: none;
}

.common-system-shortcuts__menu a {
  display: block;
  padding: 7px 5px;
  border-radius: 7px;
  color: #f8fafc;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.common-system-shortcuts__menu a:hover {
  background: #172434;
}

.common-system-shortcuts__menu a.is-active,
.common-system-shortcuts__menu a.active,
.common-system-shortcuts__menu a[aria-current="page"] {
  background: #0b6f65;
  color: #ffffff;
  box-shadow: inset 3px 0 0 #5eead4;
}

.nav-list {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.nav-item {
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  color: #dbe4ef;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  background: var(--nav-2);
  color: #ffffff;
}

.mode-switch {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #334257;
  border-radius: 8px;
  overflow: hidden;
}

.mode-switch button {
  border: 0;
  color: #dbe4ef;
  background: transparent;
  padding: 7px 3px;
  cursor: pointer;
  font-size: 12px;
}

.mode-switch .selected {
  background: #0b6f65;
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 24px;
  max-width: 1800px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 30;
  padding: 0 0 12px;
  background: rgba(238, 243, 246, 0.92);
  backdrop-filter: blur(12px);
  min-height: 72px;
  overflow: visible;
}

.frame-resize-handle {
  position: absolute;
  z-index: 70;
  touch-action: none;
}

.sidebar-width-handle {
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
}

.sidebar-width-handle::after {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: rgba(219, 228, 239, 0.24);
}

.sidebar-width-handle:hover::after,
.frame-resizing-x .sidebar-width-handle::after {
  background: rgba(8, 121, 111, 0.9);
}

.topbar-height-handle {
  left: 0;
  right: 0;
  bottom: -6px;
  height: 12px;
  cursor: row-resize;
}

.topbar-height-handle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: rgba(39, 69, 105, 0.12);
}

.topbar-height-handle:hover::after,
.frame-resizing-y .topbar-height-handle::after {
  background: rgba(8, 121, 111, 0.85);
}

.frame-resizing {
  user-select: none;
}

.frame-resizing-x {
  cursor: col-resize;
}

.frame-resizing-y {
  cursor: row-resize;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  letter-spacing: 0;
}

.topbar p {
  color: var(--muted);
  margin-top: 7px;
}

.top-actions,
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}

.auth-box select,
.auth-box input {
  min-height: 34px;
  width: 130px;
}

.auth-box input {
  width: 82px;
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 24, 35, 0.58);
}

.guide-modal.open {
  display: flex;
}

.guide-panel {
  width: min(980px, 100%);
  max-height: min(86vh, 860px);
  overflow: hidden;
  border: 1px solid rgba(213, 221, 232, 0.88);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.28);
  display: grid;
  grid-template-rows: auto 1fr;
}

.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.guide-head span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

.guide-body {
  overflow: auto;
  padding: 18px 20px 22px;
  display: block;
}

.guide-tabs,
.guide-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.guide-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  padding: 9px 12px;
  cursor: pointer;
}

.guide-tab.is-active {
  border-color: var(--accent);
  background: #e9fbf6;
  color: var(--accent);
}

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

.guide-tab-panel.is-active {
  display: grid;
}

.guide-tab-panel section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.guide-body h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.guide-body p,
.guide-body li {
  color: #475467;
  line-height: 1.62;
  font-size: 14px;
}

.guide-body p,
.guide-body ul {
  margin: 0;
}

.guide-body ul {
  padding-left: 18px;
}

.linehaul-group-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.linehaul-group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.linehaul-group-card:hover,
.linehaul-group-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.linehaul-group-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.linehaul-group-card h3 {
  margin: 0;
  font-size: 14px;
}

.linehaul-group-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.linehaul-group-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.linehaul-group-metrics span {
  display: grid;
  gap: 2px;
  border-radius: 7px;
  background: #f8fafc;
  padding: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.linehaul-group-metrics strong {
  color: var(--text);
  font-size: 14px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.search span {
  color: var(--muted);
  font-size: 13px;
}

.search input {
  border: 0;
  outline: 0;
  width: 220px;
}

.primary-button,
.ghost-button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(8, 121, 111, 0.18);
}

.ghost-button {
  color: var(--ink);
  background: #f3f6fa;
  border-color: var(--line);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.small {
  padding: 8px 11px;
  font-size: 14px;
}

.tiny {
  padding: 5px 8px;
  font-size: 11px;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.file-button input[type="file"] {
  display: none;
}

.slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.slot-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.slot-check input {
  margin: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel,
.client-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-visual {
  position: relative;
  min-height: 190px;
  margin-bottom: 16px;
  border: 1px solid rgba(213, 221, 232, 0.85);
  border-radius: 8px;
  overflow: hidden;
  background: #111827;
  box-shadow: var(--shadow);
}

.dashboard-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.74;
}

.dashboard-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 24, 35, 0.84), rgba(16, 24, 35, 0.42) 46%, rgba(16, 24, 35, 0.18));
}

.dashboard-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding: 30px;
  color: #ffffff;
  display: grid;
  gap: 9px;
}

.dashboard-visual-copy span {
  font-size: 12px;
  font-weight: 800;
  color: #9ee4dc;
}

.dashboard-visual-copy strong {
  font-size: 30px;
  letter-spacing: 0;
}

.dashboard-visual-copy small {
  font-size: 15px;
  line-height: 1.55;
  color: #d6e3ef;
}

.metric {
  padding: 18px;
  display: grid;
  gap: 7px;
  box-shadow: var(--shadow-soft);
}

.metric span,
.settlement-summary span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 25px;
}

.metric small {
  color: var(--muted);
}

.metric.urgent {
  border-color: #e6b15d;
  background: #fffbf2;
}

.dashboard-layout,
.section-grid,
.quote-layout,
.map-layout,
.outbound-layout,
.portal-layout {
  display: grid;
  gap: 16px;
}

.dashboard-layout {
  grid-template-columns: minmax(320px, 0.9fr) minmax(500px, 1.2fr);
}

.section-grid {
  grid-template-columns: 380px 1fr;
}

.quote-layout,
.outbound-layout {
  grid-template-columns: 420px 1fr;
}

.portal-layout {
  grid-template-columns: 420px 1fr;
}

.map-layout {
  grid-template-columns: 1fr;
  align-items: start;
}

.map-panel,
.location-detail {
  width: 100%;
}

.split-layout-resizable {
  position: relative;
  grid-template-columns: minmax(280px, var(--split-left, 420px)) minmax(300px, 1fr) !important;
  align-items: stretch;
}

.split-layout-resizable > .panel {
  width: auto !important;
  min-width: 0;
}

.split-layout-resizable > .split-layout-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--split-left, 420px) + 8px);
  width: 18px;
  margin-left: -9px;
  cursor: col-resize;
  z-index: 25;
  touch-action: none;
}

.split-layout-resizable > .split-layout-handle::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: 2px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.36);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.68);
}

.split-layout-resizable > .split-layout-handle:hover::before,
.frame-resizing-x .split-layout-resizable > .split-layout-handle::before {
  background: rgba(8, 121, 111, 0.95);
  box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.16);
}

.panel {
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.user-resizable-panel {
  position: relative;
  resize: none;
  overflow: auto;
  min-width: min(280px, 100%);
  min-height: 180px;
  max-width: none;
}

.resize-handle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border-right: 3px solid rgba(98, 112, 123, 0.58);
  border-bottom: 3px solid rgba(98, 112, 123, 0.58);
  cursor: nwse-resize;
  z-index: 8;
  touch-action: none;
}

.resize-handle:hover {
  border-color: var(--accent);
}

.collapse-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  z-index: 9;
  cursor: pointer;
}

.collapse-handle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.collapsed-layout {
  height: 64px !important;
  min-height: 64px !important;
  overflow: hidden !important;
}

.collapsed-layout > :not(.panel-head):not(h2):not(.collapse-handle):not(.resize-handle) {
  display: none !important;
}

.resizing-layout {
  user-select: none;
  cursor: nwse-resize;
}

.panel-resize-tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.panel-resize-tools button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 7px;
  cursor: pointer;
}

.panel-resize-tools button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f4f9ff;
}

.panel-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: #475467;
  font-size: 12px;
  background: var(--surface-soft);
  position: sticky;
  top: 0;
  z-index: 1;
}

.selected-row td {
  background: #eef8f5;
}

.work-list,
.client-list,
.quote-form,
.portal-form,
.scan-box,
.check-list {
  display: grid;
  gap: 10px;
}

.portal-actions {
  margin-top: 14px;
}

.work-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.tag.inbound {
  background: #e4f5ee;
  color: var(--ok);
}

.tag.outbound {
  background: #e9eefb;
  color: var(--accent-2);
}

.tag.alert {
  background: #fff2d8;
  color: var(--warn);
}

.client-card {
  padding: 14px;
  cursor: pointer;
  box-shadow: none;
}

.client-card.active {
  border-color: var(--accent);
}

.client-card strong,
.client-card span {
  display: block;
}

.client-card span {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
}

.detail-panel {
  min-height: 440px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.detail-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.detail-stat span,
.detail-stat small {
  color: var(--muted);
}

.detail-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #ffffff;
  color: var(--ink);
}

.quote-result-list {
  display: grid;
  gap: 9px;
}

.upload-box {
  border: 1px dashed #b6c2d0;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: var(--surface-soft);
}

.upload-box strong,
.upload-box span {
  display: block;
}

.upload-box span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.upload-box input {
  border: 0;
  background: transparent;
  min-height: auto;
  padding: 0;
}

.quick-inbound-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.7fr;
  gap: 12px;
  margin-bottom: 14px;
}

.quick-inbound-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.quick-inbound-search {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: end;
}

.quick-inbound-search label,
.quick-inbound-entry label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.quick-product-result {
  margin-top: 10px;
}

.quick-inbound-entry {
  display: grid;
  grid-template-columns: 1.5fr 0.6fr 0.5fr auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.manual-sku-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0;
  background: #f8fbfc;
}

.compact-head {
  margin-bottom: 12px;
  min-height: auto;
}

.compact-head h3 {
  margin: 0;
  font-size: 15px;
}

.manual-sku-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.table-filter-head {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.table-filter-head::after {
  content: "+";
  color: var(--muted);
  font-size: 10px;
}

.table-filter-head.is-active[data-direction="asc"]::after {
  content: "A";
  color: var(--accent);
}

.table-filter-head.is-active[data-direction="desc"]::after {
  content: "D";
  color: var(--accent);
}

.table-filter-input {
  width: 100%;
  min-width: 74px;
  margin-top: 6px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
}

.linehaul-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.linehaul-direct-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  align-items: end;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.linehaul-direct-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-status {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.upload-preview-panel {
  margin-top: 16px;
}

.quote-document-panel {
  margin-top: 16px;
  display: none;
}

.rate-card-panel {
  margin-top: 16px;
}

.operation-panel,
.operation-table {
  margin-top: 16px;
}

.operation-table tr[data-work-id],
.operation-table tr[data-rework-order] {
  cursor: pointer;
}

.operation-table tr[data-work-id]:hover td,
.operation-table tr[data-rework-order]:hover td {
  background: #f0f6fb;
}

.field-log-summary,
.field-work-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.field-log-summary div,
.field-work-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.field-log-summary span,
.field-work-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.field-log-summary strong,
.field-work-summary strong {
  font-size: 20px;
}

.mini-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e6eaf0;
  overflow: hidden;
  margin-top: 8px;
}

.mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.field-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.field-filter-row select {
  min-height: 36px;
}

.field-worker-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.worker-chip {
  text-align: left;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.worker-chip:hover {
  border-color: #a9c7df;
  background: #f3f8fc;
}

.worker-chip strong,
.worker-chip span {
  display: block;
}

.worker-chip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.portal-ai-panel {
  grid-column: 1 / -1;
}

.portal-ai-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ai-report-box {
  border: 1px solid #cce7df;
  border-radius: 8px;
  background: #f2faf7;
  margin-top: 12px;
  padding: 12px 14px;
}

.ai-report-box p {
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.55;
  font-size: 14px;
}

.ai-report-box p:last-child {
  margin-bottom: 0;
}

.portal-ai-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.portal-ai-item strong,
.portal-ai-item small {
  display: block;
}

.portal-ai-item small {
  color: var(--muted);
  margin-top: 3px;
}

.rework-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 260px;
}

.rework-checklist span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.rework-checklist .pass {
  background: #e4f5ee;
  color: var(--ok);
}

.rework-checklist .fail {
  background: #ffe2e2;
  color: var(--danger);
}

.rework-memo {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.ai-stock-summary,
.outbound-summary,
.rework-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.ai-stock-summary div,
.outbound-summary div,
.rework-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.ai-stock-summary span,
.outbound-summary span,
.rework-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.ai-stock-summary strong,
.outbound-summary strong,
.rework-summary strong {
  font-size: 20px;
}

@media (max-width: 720px) {
  .field-log-summary,
  .field-work-summary,
  .ai-stock-summary,
  .outbound-summary,
  .rework-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-worker-summary {
    grid-template-columns: 1fr;
  }
}

.quote-document-panel.open {
  display: block;
}

.quote-document {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
}

.quote-doc-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  border-bottom: 2px solid #17212b;
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.quote-doc-title h3 {
  font-size: 28px;
  margin: 0 0 8px;
}

.quote-doc-title p,
.quote-doc-info p,
.quote-doc-note,
.empty-doc {
  color: var(--muted);
}

.quote-doc-info {
  display: grid;
  gap: 6px;
  justify-content: end;
  text-align: right;
}

.quote-doc-section {
  margin-top: 18px;
}

.quote-doc-section h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.quote-doc-total {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quote-doc-total div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.quote-doc-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.quote-doc-total strong {
  font-size: 18px;
}

.quote-doc-note {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 13px;
  line-height: 1.6;
}

.table-scroll {
  overflow: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 980px;
}

.charge-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.charge-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.total-row {
  margin-top: 12px;
  padding: 14px;
  background: #eef8f5;
  border: 1px solid #cce7df;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.warehouse-map {
  min-height: 560px;
  padding: 14px;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}

.warehouse-plan {
  position: relative;
  min-height: clamp(520px, 58vw, 760px);
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(100, 116, 139, 0.18) 1px, transparent 1px) 0 0 / 12.5% 100%,
    linear-gradient(0deg, rgba(100, 116, 139, 0.16) 1px, transparent 1px) 0 0 / 100% 20%,
    #f8fafc;
}

.location-detail {
  display: grid;
  gap: 14px;
}

.location-detail > table {
  width: 100%;
  border-collapse: collapse;
}

.location-detail > table th,
.location-detail > table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.location-detail > table th {
  width: 150px;
  color: var(--muted);
  font-size: 13px;
}

.plan-title {
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 5;
  display: grid;
  gap: 3px;
}

.plan-title strong {
  font-size: 15px;
}

.plan-title span {
  font-size: 12px;
  color: var(--muted);
}

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: #334155;
  font-weight: 800;
}

.plan-legend em {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  margin-right: -4px;
  border: 2px solid currentColor;
}

.legend-red {
  color: #dc2626;
  background: rgba(254, 226, 226, 0.85);
}

.legend-yellow {
  color: #eab308;
  background: rgba(254, 249, 195, 0.95);
}

.legend-green {
  color: #16a34a;
  background: rgba(220, 252, 231, 0.95);
}

.legend-blue {
  color: #2563eb;
  background: rgba(219, 234, 254, 0.95);
}

.plan-grid span {
  position: absolute;
  top: 58px;
  z-index: 4;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #111827;
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
}

.plan-used-area {
  position: absolute;
  left: 5%;
  top: 18%;
  width: 91%;
  height: 76%;
  clip-path: polygon(0 8%, 10% 0, 96% 1%, 100% 5%, 100% 100%, 58% 100%, 58% 80%, 42% 80%, 42% 55%, 18% 55%, 18% 100%, 8% 100%, 8% 68%, 0 68%);
  background: repeating-linear-gradient(150deg, rgba(211, 73, 73, 0.08), rgba(211, 73, 73, 0.08) 18px, rgba(211, 73, 73, 0.34) 20px, rgba(211, 73, 73, 0.34) 23px);
  border: 3px solid rgba(211, 73, 73, 0.82);
}

.plan-wall {
  position: absolute;
  z-index: 3;
  background: #111827;
  border-radius: 999px;
}

.plan-wall.top {
  left: 8%;
  top: 19%;
  width: 88%;
  height: 7px;
  transform: rotate(-1deg);
}

.plan-wall.right {
  left: 96%;
  top: 20%;
  width: 7px;
  height: 74%;
}

.plan-wall.bottom {
  left: 58%;
  top: 94%;
  width: 38%;
  height: 7px;
}

.plan-wall.inner-a {
  left: 57%;
  top: 19%;
  width: 7px;
  height: 38%;
}

.plan-wall.inner-b {
  left: 42%;
  top: 55%;
  width: 7px;
  height: 26%;
}

.plan-core {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  border: 2px solid #111827;
  background: #e5e7eb;
  border-radius: 6px;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.plan-core.eps {
  left: 13%;
  top: 32%;
  width: 7%;
  height: 9%;
}

.plan-core.stairs {
  left: 74%;
  top: 34%;
  width: 8%;
  height: 13%;
}

.plan-core.dock {
  left: 58%;
  top: 84%;
  width: 12%;
  height: 9%;
}

.plan-location {
  position: absolute;
  z-index: 6;
  border: 2px solid #1d4ed8;
  border-radius: 8px;
  padding: 9px;
  display: grid;
  align-content: start;
  gap: 3px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
}

.plan-location strong {
  font-size: 22px;
}

.plan-location span,
.plan-location small {
  font-size: 12px;
  font-weight: 800;
}

.plan-location.hot {
  background: rgba(254, 226, 226, 0.9);
  border-color: #dc2626;
}

.plan-location.rack {
  background: rgba(219, 234, 254, 0.92);
}

.plan-location.reserve {
  background: rgba(220, 252, 231, 0.92);
  border-color: #15803d;
}

.plan-location.flat {
  background: rgba(254, 249, 195, 0.96);
  border-color: #eab308;
}

.plan-location.dock {
  background: rgba(220, 252, 231, 0.94);
  border-color: #16a34a;
}

.plan-location.office {
  background: rgba(224, 231, 255, 0.94);
  border-color: #4f46e5;
}

.plan-location.selected {
  outline: 4px solid #111827;
}

.map-slot-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.map-empty {
  color: var(--muted);
  font-weight: 700;
}

.loc {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  min-width: 0;
}

.loc strong,
.loc span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc strong {
  font-size: 13px;
}

.loc span {
  font-size: 12px;
}

.loc.free {
  background: #dbf3e4;
  color: #14542b;
}

.loc.busy {
  background: #fff0c2;
  color: #6f4300;
}

.loc.full {
  background: #ffdada;
  color: #842121;
}

.loc.hold {
  background: #e9e4ff;
  color: #4b3a91;
}

.loc.selected {
  outline: 3px solid #17212b;
}

.detail-chip-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.detail-chip-group strong {
  width: 100%;
  font-size: 13px;
}

.detail-chip {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.location-stock-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.stock-box-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.stock-box-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-table table {
  min-width: 760px;
}

.compact-table th,
.compact-table td {
  font-size: 12px;
  padding: 8px;
}

.table-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
  padding: 0;
}

#fieldRows td:nth-child(6) {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend .free {
  background: #83d59b;
}

.legend .busy {
  background: #f0c24e;
}

.legend .full {
  background: #e87575;
}

.legend .hold {
  background: #9d8ddb;
}

.recommendation {
  border-left: 4px solid var(--accent);
  padding: 12px;
  background: #f2faf7;
  border-radius: 6px;
  margin-top: 12px;
}

.status-pill.waiting {
  background: #eef2f6;
  color: #475467;
}

.status-pill.pass {
  background: #e4f5ee;
  color: var(--ok);
}

.status-pill.fail {
  background: #ffe2e2;
  color: var(--danger);
}

.status-pill.working {
  background: #fff4d6;
  color: #8a5a00;
}

.check-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef2f6;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.check-list li.pass .check-icon {
  background: #dff3e6;
  color: var(--ok);
}

.check-list li.fail .check-icon {
  background: #ffdada;
  color: var(--danger);
}

.field-step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.field-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  min-width: 0;
}

.field-step strong,
.field-step span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-step strong {
  font-size: 12px;
  color: var(--muted);
}

.field-step span {
  margin-top: 4px;
  font-weight: 800;
  color: var(--text);
}

.field-step.done {
  border-color: #b9dfc4;
  background: #eaf8ee;
}

.field-step.todo {
  border-color: #f1c2c2;
  background: #fff5f5;
}

.product-preview {
  margin-top: 12px;
}

.product-preview-empty,
.product-preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.product-preview-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.product-preview-card {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 14px;
  padding: 12px;
}

.oms-queue-panel {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.oms-queue-panel.prominent {
  margin: 0 0 18px;
  border-color: #b7d5f5;
  background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.oms-queue-panel h3 {
  margin: 0;
  font-size: 16px;
}

.oms-queue-panel .panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.shipper-admin-grid,
.shipper-account-form {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.shipper-admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shipper-account-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.product-image-box {
  min-height: 98px;
  border-radius: 8px;
  background: linear-gradient(135deg, #23313f, #607383);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-weight: 900;
  font-size: 24px;
}

.product-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-preview-body {
  min-width: 0;
}

.product-preview-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.product-preview-title strong,
.product-preview-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-preview-title strong {
  color: var(--text);
}

.product-preview-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.product-meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  min-width: 0;
}

.product-meta-grid span,
.product-meta-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-meta-grid span {
  font-size: 11px;
  color: var(--muted);
}

.product-meta-grid strong {
  margin-top: 3px;
  font-size: 13px;
}

.spec-chip-row,
.guard-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.spec-chip-row span,
.guard-item {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.spec-chip-row span {
  background: #edf2f7;
  color: #405162;
}

.guard-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2f6;
  color: #465567;
}

.guard-item.pass {
  background: #e4f5ee;
  color: var(--ok);
}

.guard-item.warn {
  background: #fff4d6;
  color: #8a5a00;
}

.guard-item.fail {
  background: #ffe2e2;
  color: var(--danger);
}

.settlement-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.settlement-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.settlement-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.settlement-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.settlement-flow span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.settlement-flow span.done {
  border-color: #b9dfc4;
  background: #eaf8ee;
  color: var(--ok);
}

.settlement-flow span.active:last-child {
  border-color: #c9d5e8;
  background: #eef4fb;
  color: var(--accent);
}

.settlement-ledger-panel {
  margin-top: 16px;
}

.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 520px;
}

.permission-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 4px 9px 4px 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.permission-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
  padding: 0;
}

.permission-check:has(input:checked) {
  border-color: #b9dfd8;
  background: #eef8f5;
  color: var(--accent);
}

@media (max-width: 980px) {
  .manual-sku-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .linehaul-upload-grid {
    grid-template-columns: 1fr;
  }

  .linehaul-direct-form {
    grid-template-columns: 1fr;
  }

  .linehaul-group-summary,
  .guide-tab-panel.is-active {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 10px 10px 8px;
    gap: 8px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    transition: padding 180ms ease, max-height 180ms ease;
  }

  .brand {
    min-height: auto;
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand span {
    display: none;
  }

  .brand strong {
    font-size: 15px;
  }

  .common-system-shortcuts summary {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 12px;
  }

  .common-system-shortcuts__menu {
    max-height: 150px;
    padding: 7px;
  }

  .common-system-shortcuts__menu a {
    padding: 6px 4px;
    font-size: 12px;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    max-width: 100%;
    padding-bottom: 2px;
  }

  .nav-item {
    text-align: center;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
    white-space: normal;
  }

  .mode-switch {
    margin-top: 0;
    min-height: 34px;
  }

  .mode-switch button {
    padding: 7px 3px;
    font-size: 12px;
  }

  body.mobile-nav-collapsed .sidebar {
    padding: 6px 10px;
    max-height: 92px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.2);
  }

  body.mobile-nav-collapsed .brand {
    min-height: 38px;
  }

  body.mobile-nav-collapsed .nav-list,
  body.mobile-nav-collapsed .mode-switch {
    display: none;
  }

  body.mobile-nav-collapsed .common-system-shortcuts {
    display: block;
  }

  body.mobile-nav-collapsed .common-system-shortcuts:not([open]) {
    margin-top: 4px;
  }

  body.mobile-nav-collapsed .topbar {
    display: none;
  }

  .field-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .top-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    position: static;
    background: transparent;
    height: auto !important;
  }

  .frame-resize-handle {
    display: none;
  }

  .split-layout-resizable {
    grid-template-columns: 1fr !important;
  }

  .split-layout-handle {
    display: none;
  }

  .auth-box,
  .search,
  .filter-row,
  .field-filter-row,
  .panel-head {
    flex-wrap: wrap;
  }

  .auth-box select,
  .auth-box input {
    width: auto;
    flex: 1 1 132px;
  }

  .guide-panel {
    max-height: 92vh;
  }

  .guide-body {
    grid-template-columns: 1fr;
  }

  .search input {
    width: 100%;
  }

  .metric-grid,
  .dashboard-layout,
  .section-grid,
  .quote-layout,
  .map-layout,
  .outbound-layout,
  .quick-inbound-grid,
  .portal-layout,
  .settlement-summary {
    grid-template-columns: 1fr;
  }

  .quick-inbound-search,
  .quick-inbound-entry {
    grid-template-columns: 1fr;
  }

  .settlement-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-map {
    grid-template-columns: repeat(4, minmax(60px, 1fr));
  }

  .dashboard-visual {
    min-height: 170px;
  }
}

@media (max-width: 620px) {
  .manual-sku-grid {
    grid-template-columns: 1fr;
  }

  body {
    font-size: 16px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .main {
    padding: 10px;
  }

  .sidebar {
    padding: 8px;
    gap: 7px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .common-system-shortcuts summary {
    min-height: 26px;
    font-size: 11px;
  }

  .common-system-shortcuts__menu {
    max-height: 132px;
  }

  .common-system-shortcuts__menu a {
    font-size: 11px;
  }

  .mode-switch button,
  .nav-item,
  .small,
  .tiny {
    font-size: 12px;
  }

  .nav-item {
    min-width: 0;
    padding: 7px 6px;
  }

  .mode-switch {
    min-height: 32px;
  }

  .dashboard-visual {
    min-height: 210px;
  }

  .dashboard-visual img {
    opacity: 0.62;
  }

  .dashboard-visual::after {
    background: rgba(16, 24, 35, 0.7);
  }

  .dashboard-visual-copy {
    padding: 22px;
    max-width: none;
  }

  .dashboard-visual-copy strong {
    font-size: 25px;
  }

  .dashboard-visual-copy small {
    font-size: 15px;
  }

  .metric-grid,
  .detail-grid,
  .quote-doc-total,
  .map-slot-row {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    gap: 10px;
  }

  .metric {
    padding: 16px;
  }

  .metric span,
  .settlement-summary span,
  .upload-box span,
  .upload-status,
  .client-card span,
  label,
  .portal-ai-item small,
  .work-item small {
    font-size: 14px;
  }

  input,
  select,
  button {
    min-height: 44px;
  }

  .primary-button,
  .ghost-button {
    padding: 10px 12px;
  }

  .panel-head {
    align-items: stretch;
  }

  .panel-head > .filter-row,
  .panel-head > button,
  .panel-head > select {
    width: 100%;
  }

  th,
  td {
    padding: 11px 9px;
    font-size: 14px;
  }

  .panel {
    padding: 14px;
  }

  .guide-modal {
    padding: 10px;
  }

  .guide-head {
    align-items: flex-start;
    padding: 14px;
  }

  .guide-body {
    padding: 12px;
  }

  .guide-body p,
  .guide-body li {
    font-size: 15px;
  }

  .warehouse-map {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    grid-auto-rows: 76px;
  }

  .warehouse-plan {
    min-height: 520px;
  }

  .product-preview-card {
    grid-template-columns: 1fr;
  }

  .product-image-box {
    min-height: 150px;
  }

  .product-meta-grid {
    grid-template-columns: 1fr;
  }

  .shipper-admin-grid,
  .shipper-account-form {
    grid-template-columns: 1fr;
  }

  .product-preview-title {
    display: block;
  }

  .product-preview-title span {
    margin-top: 4px;
  }

  .plan-grid span {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .plan-location {
    padding: 7px;
  }

  .plan-location strong {
    font-size: 18px;
  }

  .work-item {
    grid-template-columns: 1fr;
  }

  .user-resizable-panel {
    width: 100% !important;
    height: auto !important;
    resize: none;
  }

  .panel-resize-tools {
    display: none;
  }

  .panel-resize-tools button {
    min-height: 30px;
    padding: 7px 8px;
  }

  .table-scroll table {
    min-width: 760px;
  }
}

@media (max-width: 760px) {
  body.mobile-outbound-focus .main {
    padding: 8px;
  }

  body.mobile-outbound-focus #outbound .outbound-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.mobile-outbound-focus #outbound .field-mobile-primary {
    order: -2;
  }

  body.mobile-outbound-focus #outbound .field-mobile-work {
    order: -1;
  }

  body.mobile-outbound-focus #outbound .panel,
  body.mobile-outbound-focus #outbound .operation-panel {
    border-radius: 8px;
    padding: 12px;
  }

  body.mobile-outbound-focus #outbound .panel-head {
    gap: 8px;
    margin-bottom: 10px;
  }

  body.mobile-outbound-focus #outbound .panel-head h2 {
    font-size: 22px;
  }

  body.mobile-outbound-focus #outbound .scan-box {
    display: grid;
    gap: 9px;
  }

  body.mobile-outbound-focus #outbound .scan-box label {
    font-size: 15px;
    font-weight: 800;
    color: #1f2937;
  }

  body.mobile-outbound-focus #outbound input,
  body.mobile-outbound-focus #outbound select {
    width: 100%;
    min-height: 54px;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 800;
  }

  body.mobile-outbound-focus #outbound #scannerInput {
    min-height: 64px;
    border-width: 2px;
    border-color: #1f6feb;
    background: #f8fbff;
    font-size: 21px;
  }

  body.mobile-outbound-focus #outbound button {
    min-height: 52px;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 900;
  }

  body.mobile-outbound-focus #outbound #verifyOutbound,
  body.mobile-outbound-focus #outbound #processScanInput,
  body.mobile-outbound-focus #outbound #completeFieldScan {
    min-height: 64px;
    font-size: 20px;
  }

  body.mobile-outbound-focus #outbound .field-mobile-work .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.mobile-outbound-focus #outbound .field-mobile-work .filter-row select,
  body.mobile-outbound-focus #outbound .field-mobile-work .filter-row button {
    width: 100%;
  }

  body.mobile-outbound-focus #outbound #fieldWorkHandlingFilter {
    grid-column: 1 / -1;
    min-height: 58px;
    border: 2px solid var(--accent);
    background: #e9fbf6;
    color: var(--accent);
    font-size: 18px;
    font-weight: 900;
  }

  body.mobile-outbound-focus #outbound .field-work-summary,
  body.mobile-outbound-focus #outbound .field-step-grid,
  body.mobile-outbound-focus #outbound .outbound-summary,
  body.mobile-outbound-focus #outbound .rework-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.mobile-outbound-focus #outbound .field-work-summary div {
    min-height: 76px;
  }

  body.mobile-outbound-focus #outbound .field-work-summary span {
    font-size: 13px;
  }

  body.mobile-outbound-focus #outbound .field-work-summary strong {
    font-size: 28px;
  }

  body.mobile-outbound-focus #outbound .upload-status {
    padding: 12px;
    font-size: 15px;
    font-weight: 800;
  }

  body.mobile-outbound-focus #outbound .table-scroll table {
    min-width: 0;
  }

  body.role-field {
    background: #f5f7fb;
    font-size: 18px;
  }

  body.role-field .app-shell {
    display: block;
  }

  body.role-field .sidebar {
    display: none;
  }

  body.role-field .main {
    padding: 8px;
  }

  body.role-field .topbar {
    position: relative;
    z-index: 20;
    padding: 10px 8px;
    border-radius: 0 0 10px 10px;
  }

  body.role-field .topbar .search,
  body.role-field .topbar .top-actions .ghost-button:not(#screenSizeResetButton),
  body.role-field .guide-button {
    display: none;
  }

  body.role-field .topbar h1 {
    font-size: 22px;
    line-height: 1.2;
  }

  body.role-field .topbar small {
    display: none;
  }

  body.role-field #outbound > .panel,
  body.role-field #outbound > .operation-panel {
    display: none;
  }

  body.role-field #outbound .outbound-layout,
  body.role-field #outbound .field-mobile-work {
    display: block;
  }

  body.role-field #outbound .outbound-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.role-field #outbound .field-mobile-primary,
  body.role-field #outbound .field-mobile-check,
  body.role-field #outbound .field-mobile-work {
    display: block;
    padding: 12px;
    border-radius: 8px;
    box-shadow: none;
  }

  body.role-field #outbound .field-mobile-check {
    display: none;
  }

  body.role-field #outbound .panel-head {
    gap: 8px;
    margin-bottom: 10px;
  }

  body.role-field #outbound .panel-head h2 {
    font-size: 23px;
  }

  body.role-field #outbound .status-pill {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 15px;
  }

  body.role-field #outbound .scan-box {
    display: grid;
    gap: 10px;
  }

  body.role-field #outbound .scan-box label {
    gap: 6px;
    font-size: 16px;
    font-weight: 800;
    color: #1f2937;
  }

  body.role-field #outbound input,
  body.role-field #outbound select {
    width: 100%;
    min-height: 58px;
    border-radius: 8px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0;
  }

  body.role-field #outbound #scannerInput {
    min-height: 66px;
    font-size: 22px;
    border-width: 2px;
    border-color: #1f6feb;
    background: #f8fbff;
  }

  body.role-field #outbound button {
    min-height: 58px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 900;
  }

  body.role-field #outbound .primary-button {
    background: #0f766e;
  }

  body.role-field #outbound #verifyOutbound,
  body.role-field #outbound #completeFieldScan {
    min-height: 68px;
    font-size: 21px;
  }

  body.role-field #outbound .field-mobile-work .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.role-field #outbound .field-mobile-work .filter-row select,
  body.role-field #outbound .field-mobile-work .filter-row button {
    width: 100%;
  }

  body.role-field #outbound #fieldWorkHandlingFilter {
    grid-column: 1 / -1;
    min-height: 64px;
    border: 2px solid var(--accent);
    background: #e9fbf6;
    color: var(--accent);
    font-size: 22px;
    font-weight: 900;
  }

  body.role-field #outbound .field-mobile-work .filter-row button:nth-of-type(n + 4) {
    display: none;
  }

  body.role-field #outbound .field-work-summary,
  body.role-field #outbound .field-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.role-field #outbound .field-work-summary div,
  body.role-field #outbound .field-step {
    padding: 12px;
    border-radius: 8px;
  }

  body.role-field #outbound .field-work-summary span,
  body.role-field #outbound .field-step span {
    font-size: 14px;
  }

  body.role-field #outbound .field-work-summary strong,
  body.role-field #outbound .field-step strong {
    font-size: 28px;
  }

  body.role-field #outbound .field-filter-row,
  body.role-field #outbound .field-worker-summary,
  body.role-field #outbound .compact-table,
  body.role-field #outbound #workerCoachingFilter,
  body.role-field #outbound #workerCoachingRows,
  body.role-field #outbound #workerCoachingHistoryRows {
    display: none;
  }

  body.role-field #outbound #fieldStatus {
    display: block;
    padding: 14px;
    border-width: 2px;
    font-size: 17px;
    font-weight: 800;
  }

  body.role-field #fieldRows {
    display: block;
  }

  body.role-field #fieldRows tr {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
    padding: 12px;
    border: 2px solid #d9e2ef;
    border-radius: 8px;
    background: #fff;
  }

  body.role-field #fieldRows td {
    display: block;
    padding: 2px 0;
    border: 0;
    font-size: 17px;
    font-weight: 800;
    white-space: normal;
  }

  body.role-field #fieldRows td:nth-child(1),
  body.role-field #fieldRows td:nth-child(2),
  body.role-field #fieldRows td:nth-child(3),
  body.role-field #fieldRows td:nth-child(6),
  body.role-field #fieldRows td:nth-child(8),
  body.role-field #fieldRows td:nth-child(9),
  body.role-field #fieldRows td:nth-child(10),
  body.role-field #fieldRows td:nth-child(11),
  body.role-field #fieldRows td:nth-child(12) {
    display: block;
  }

  body.role-field #fieldRows td:nth-child(4),
  body.role-field #fieldRows td:nth-child(5),
  body.role-field #fieldRows td:nth-child(7) {
    display: none;
  }

  body.role-field #outbound .table-scroll {
    overflow: visible;
  }

  body.role-field #outbound .table-scroll table {
    min-width: 0;
    width: 100%;
  }

  body.role-field #outbound .table-scroll thead {
    display: none;
  }
}

@media (max-width: 390px) {
  .main {
    padding: 10px;
  }

  .metric strong {
    font-size: 22px;
  }

  .dashboard-visual-copy strong {
    font-size: 22px;
  }

  .field-log-summary,
  .field-work-summary,
  .ai-stock-summary,
  .outbound-summary,
  .rework-summary,
  .settlement-summary {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .view:not(#quote),
  #quote > .quote-layout,
  #quote > .upload-preview-panel,
  #quoteDocumentPanel > .panel-head {
    display: none !important;
  }

  .app-shell,
  .main {
    display: block;
    padding: 0;
  }

  #quote,
  #quoteDocumentPanel {
    display: block !important;
  }

  .quote-document-panel,
  .quote-document {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

.inline-input {
  width: 100%;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  font: inherit;
  background: #fff;
}

.inline-input.number {
  text-align: right;
}

.inline-input:disabled {
  background: #f1f4f7;
  color: var(--muted);
}

.correction-cell {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.correction-button {
  justify-self: start;
}

.hidden-capture {
  display: none;
}

.settlement-approval-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 12px 0 14px;
  flex-wrap: wrap;
}

[data-settlement-category] {
  cursor: pointer;
}

[data-settlement-category]:hover {
  background: #eef6f3;
}

.inbound-flow-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.flow-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-areas:
    "num title"
    "num copy";
  gap: 3px 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.flow-step span {
  grid-area: num;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #edf2f7;
  color: var(--muted);
  font-weight: 800;
}

.flow-step strong {
  grid-area: title;
  font-size: 14px;
}

.flow-step small {
  grid-area: copy;
  color: var(--muted);
  line-height: 1.35;
}

.flow-step.done {
  border-color: #bde4dc;
  background: #f2fbf8;
}

.flow-step.done span {
  background: var(--accent);
  color: #ffffff;
}

.flow-step.fail {
  border-color: #f2b8b5;
  background: #fff6f5;
}

.flow-step.fail span {
  background: var(--danger);
  color: #ffffff;
}

.inbound-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.core-request-panel {
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 12px;
}

.mini-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.mini-panel-head span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .inbound-flow-status {
    grid-template-columns: 1fr;
  }
}
