:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #667085;
  --line: #e3e8f1;
  --rail: #0d1422;
  --blue: #3d6bff;
  --green: #12b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #7c3aed;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

#root {
  min-height: 100vh;
}

.app-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(220px, 14vw, 248px) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  background: var(--bg);
  overflow: hidden;
}

.app-shell.is-dashboard {
  grid-template-columns: clamp(220px, 14vw, 248px) minmax(0, 1fr);
}

.sidebar,
.panel,
.workspace,
.header-card,
.metric-card,
.table-card,
.section-card,
.detail-card,
.drawer {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 40px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 18px;
  background: var(--rail);
  color: #f6f7f9;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-radius: 24px;
  box-shadow: none;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-sub {
  font-size: 13px;
  color: #98a2b3;
  line-height: 1.5;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #cbd5e1;
  transition: 0.18s ease;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.nav-item small {
  color: #64748b;
  font-size: 11px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.workspace {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
}

.title-wrap h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  color: var(--ink);
}

.title-wrap p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.search-box {
  width: 260px;
  height: 50px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: none;
  padding: 12px 16px;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
}

.current-user-select {
  height: 50px;
  min-width: 220px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-user-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.current-user-select select {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.current-user-select strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.login-panel {
  width: min(440px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
  font-size: 27px;
  font-weight: 900;
}

.login-subtitle,
.login-heading span,
.login-hint {
  color: var(--muted);
  font-size: 13px;
}

.login-subtitle {
  margin: 8px 0 34px;
}

.login-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.login-heading h1 {
  margin: 0;
  font-size: 22px;
}

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

.login-form .field {
  gap: 8px;
}

.login-form .field span {
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  min-height: 48px;
}

.login-button {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid rgba(239, 68, 68, 0.24);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.login-hint {
  margin-top: 18px;
  line-height: 1.6;
}

.avatar-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--blue);
  font-weight: 800;
  border: 1px solid rgba(16, 20, 26, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--surface-soft);
}

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 700;
}

.btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

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

.metric-card {
  padding: 18px 18px 16px;
  min-height: 112px;
  border-radius: var(--radius-md);
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
}

.metric-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.metric-foot {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.tab.active {
  background: color-mix(in srgb, var(--accent-color, #7ef0c2) 18%, transparent);
  color: #fff;
  border-color: color-mix(in srgb, var(--accent-color, #7ef0c2) 40%, transparent);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
}

.content-grid > * {
  min-width: 0;
}

.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.dash-stat {
  border-radius: 28px;
  min-height: 144px;
  padding: 22px 24px 18px;
}

.dash-stat .metric-value {
  font-size: 42px;
  line-height: 1;
}

.dash-panel {
  border-radius: 28px;
  padding: 24px 26px;
  background: rgba(246, 247, 249, 0.98);
  color: #10141a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

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

.dashboard-grid .dash-panel:last-child .btn.primary.wide {
  margin-top: 16px;
}

.flow-list,
.task-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flow-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
}

.flow-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.flow-status-button,
.flow-count-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.flow-status-button:hover,
.flow-status-button:focus-visible,
.flow-count-button:hover,
.flow-count-button:focus-visible {
  color: var(--blue);
  outline: none;
}

.flow-track {
  height: 18px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.flow-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.flow-count {
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}

.flow-count-button {
  width: 100%;
  text-align: right;
}

.task-item {
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-task-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dashboard-task-button:hover,
.dashboard-task-button:focus-visible {
  border-color: var(--blue);
  background: #f4f7ff;
  outline: none;
}

.dashboard-task-empty {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--surface-soft);
}

.task-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-main strong {
  font-size: 14px;
}

.task-main span {
  color: var(--muted);
  font-size: 12px;
}

.task-tag {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  font-size: 12px;
}

.task-tag.blue { background: var(--blue); }
.task-tag.red { background: var(--red); }
.task-tag.orange { background: var(--orange); }
.task-tag.purple { background: var(--purple); }

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

.alert-mini-item {
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.alert-mini-item strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.alert-mini-item span,
.alert-mini-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.alert-filter-bar {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.alert-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.alert-stat-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.alert-stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.alert-stat-grid strong {
  font-size: 22px;
  line-height: 1;
}

.alert-tracking-card {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(61, 107, 255, 0.18);
  border-radius: 14px;
  background: #f5f8ff;
}

.alert-tracking-card > div {
  min-width: 0;
  padding-right: 10px;
  border-right: 1px solid rgba(61, 107, 255, 0.12);
}

.alert-tracking-card > div:last-child {
  border-right: 0;
}

.alert-tracking-card span,
.alert-tracking-card strong {
  display: block;
}

.alert-tracking-card span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.alert-tracking-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-resolution-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.alert-resolution-panel strong,
.alert-resolution-panel span {
  display: block;
}

.alert-resolution-panel strong {
  margin-bottom: 5px;
  font-size: 14px;
}

.alert-resolution-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.btn.wide {
  width: 100%;
  margin-top: 20px;
  justify-content: center;
}

.feedback-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(18, 185, 129, 0.2);
  border-radius: 12px;
  background: #f0fdf8;
  color: #0f7d58;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  font-size: 13px;
  font-weight: 700;
}

.page-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(18, 185, 129, 0.2);
  border-radius: 12px;
  background: #f0fdf8;
  color: #0f7d58;
  font-size: 13px;
  font-weight: 700;
}

.page-feedback.is-error {
  border-color: rgba(239, 68, 68, 0.2);
  background: #fff5f5;
  color: #c53030;
}

.page-feedback .feedback-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: currentColor;
}

.is-required span {
  color: var(--red);
  font-weight: 800;
}

.permission-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: auto;
}

.permission-row {
  display: grid;
  grid-template-columns: 160px repeat(12, 86px);
  gap: 10px;
  min-width: 1240px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
}

.permission-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

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

.permission-head {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.permission-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.permission-home-card {
  width: 100%;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.permission-home-card:hover {
  border-color: rgba(64, 101, 255, 0.35);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.permission-card-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.permission-card-note {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.permission-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.permission-card-foot strong {
  color: var(--ink);
}

.permission-card-foot em {
  color: var(--blue);
  font-style: normal;
  font-weight: 800;
}

.permission-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.permission-stat-grid > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.permission-stat-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.permission-stat-grid strong {
  font-size: 24px;
  line-height: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-toast.is-error {
  border-color: rgba(239, 68, 68, 0.2);
  background: #fff5f5;
  color: #c53030;
}

.feedback-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.shipment-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.shipment-link:hover strong {
  color: var(--accent-color);
}

.detail-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.detail-edit-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.detail-edit-fieldset:disabled input,
.detail-edit-fieldset:disabled select,
.detail-edit-fieldset:disabled textarea {
  color: var(--ink);
  background: #f8fafc;
  cursor: default;
  opacity: 1;
}

.detail-edit-fieldset:disabled .sku-line-row {
  background: #f8fafc;
}

.success-note,
.warning-note {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.55;
}

.success-note {
  color: #0f7d58;
  background: rgba(18, 185, 129, 0.1);
  border: 1px solid rgba(18, 185, 129, 0.18);
}

.warning-note {
  color: #9a6700;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.table-card,
.section-card,
.detail-card,
.drawer {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.table-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 148px);
  overflow: hidden;
}

.section-card h3,
.table-card h3,
.detail-card h3,
.drawer h3 {
  margin: 0;
  font-size: 16px;
}

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

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

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

.table-scroll {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: min(64vh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.table-scroll > .table {
  min-width: 920px;
}

.table-scroll .table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--line);
}

.shipment-table {
  min-width: 1180px;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}

.missing-data {
  color: #dc3c43 !important;
}

.mapping-segmented-control {
  display: inline-flex;
  gap: 4px;
  margin: 4px 0 14px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f7f9fc;
}

.mapping-segmented-control button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #69778e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mapping-segmented-control button.active {
  background: #fff;
  color: #245de8;
  box-shadow: 0 1px 4px rgba(23, 42, 80, 0.1);
}

.mapping-segmented-control span {
  margin-left: 4px;
  color: inherit;
  font-size: 12px;
  font-weight: 500;
}

.mapping-summary-row {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 34px;
  margin-bottom: 8px;
  color: #69778e;
  font-size: 13px;
}

.mapping-summary-row strong {
  margin-left: 4px;
  color: #101827;
  font-size: 15px;
}

.mapping-summary-row .missing-data strong {
  color: #dc3c43;
}

.filter-result-note {
  min-height: 24px;
  margin: -2px 0 10px;
  color: #69778e;
  font-size: 12px;
  line-height: 1.5;
}

.filter-result-note span {
  color: #9aa6b8;
}

.mapping-data-table {
  min-width: 1020px;
}

.mapping-limit-note {
  margin-top: 10px;
}

.mapping-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.mapping-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.mapping-status-summary strong {
  color: var(--ink);
}

.mapping-detail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.mapping-detail-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mapping-detail-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px 84px;
  gap: 10px;
  align-items: center;
}

.mapping-detail-row input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--ink);
}

.mapping-detail-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.shipment-table th,
.shipment-table td {
  white-space: nowrap;
}

.shipment-table th:nth-child(1),
.shipment-table td:nth-child(1) {
  width: 44px;
}

.shipment-table th:nth-child(2),
.shipment-table td:nth-child(2) {
  min-width: 170px;
}

.shipment-table th:nth-child(3),
.shipment-table td:nth-child(3) {
  min-width: 88px;
}

.shipment-table th:nth-child(4),
.shipment-table td:nth-child(4) {
  min-width: 88px;
}

.shipment-table th:nth-child(5),
.shipment-table td:nth-child(5) {
  min-width: 76px;
}

.shipment-table th:nth-child(6),
.shipment-table td:nth-child(6) {
  min-width: 84px;
}

.shipment-table th:nth-child(7),
.shipment-table td:nth-child(7) {
  min-width: 180px;
}

.shipment-table th:nth-child(8),
.shipment-table td:nth-child(8) {
  min-width: 110px;
}

.shipment-table th:nth-child(9),
.shipment-table td:nth-child(9) {
  min-width: 110px;
}

.shipment-table th:nth-child(10),
.shipment-table td:nth-child(10) {
  min-width: 72px;
}

.shipment-table th:nth-child(11),
.shipment-table td:nth-child(11) {
  min-width: 250px;
}

.shipment-table td:nth-child(11) {
  white-space: nowrap;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #fafcff;
}

.table .select-col {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

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

.detail-back-row {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.back-button {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  padding-left: 0;
}

.back-button:hover {
  color: var(--blue);
  background: transparent;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.green {
  background: rgba(18, 185, 129, 0.12);
  color: #0f7d58;
}

.pill.blue {
  background: rgba(61, 107, 255, 0.12);
  color: #2f5ac7;
}

.pill.orange {
  background: rgba(245, 158, 11, 0.14);
  color: #a16207;
}

.pill.red,
.btn.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #c53030;
}

.btn.danger {
  border-color: rgba(239, 68, 68, 0.24);
}

.role-select {
  width: auto;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 42px;
}

.docs-type-filter,
.docs-shipment-select {
  width: auto;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 42px;
}

.docs-source-summary {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}

.docs-source-summary .field {
  min-width: 0;
}

.docs-source-summary .mini-item {
  min-height: 70px;
  background: #fff;
  border: 1px solid var(--line);
}

.docs-action-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.docs-field-check {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow-x: auto;
}

.compact-table {
  min-width: 720px;
}

.compact-table th,
.compact-table td {
  height: 44px;
  padding: 10px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.docs-archive-record {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.docs-archive-record .detail-section-hd {
  margin-bottom: 10px;
}

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

.fee-summary-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.fee-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.fee-summary-grid strong {
  font-size: 22px;
}

.fee-status-text {
  font-size: 18px !important;
  color: var(--blue);
}

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

.fee-breakdown-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.fee-breakdown-card > strong {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.fee-chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fee-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.fee-chip.green {
  background: rgba(18, 185, 129, 0.12);
  color: #0f7d58;
}

.fee-chip.orange {
  background: rgba(245, 158, 11, 0.14);
  color: #9a6700;
}

.fee-chip.red {
  background: rgba(239, 68, 68, 0.12);
  color: #c53030;
}

.fee-workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.fee-step {
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.fee-step strong,
.fee-step span {
  display: block;
}

.fee-step strong {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
}

.fee-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.fee-step.done {
  border-color: rgba(18, 185, 129, 0.3);
  background: #f0fdf8;
}

.fee-step.active {
  border-color: rgba(61, 107, 255, 0.26);
  background: #f4f7ff;
}

.fee-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  max-height: min(62vh, 680px);
}

.fee-row {
  display: grid;
  grid-template-columns: 1.1fr 1.15fr 0.8fr 0.7fr 1fr 0.9fr 0.9fr 1.1fr 0.65fr;
  gap: 8px;
  min-width: 960px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
}

.fee-row input,
.fee-row select {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.fee-row input:disabled,
.fee-row select:disabled {
  background: #f1f5f9;
  color: var(--muted);
}

.fee-head {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.fee-head span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
}

.fee-action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.fee-action-panel strong,
.fee-action-panel span {
  display: block;
}

.fee-action-panel strong {
  margin-bottom: 5px;
  font-size: 14px;
}

.fee-action-panel span {
  color: var(--muted);
  font-size: 12px;
}

.fee-audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fee-audit-log-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 74px minmax(220px, 1.2fr) minmax(170px, 0.9fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.fee-audit-log-row strong,
.fee-audit-log-row span,
.fee-audit-log-status {
  display: block;
}

.fee-audit-log-row strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.fee-audit-log-row > div span,
.fee-audit-log-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.fee-audit-log-row > div span + span {
  margin-top: 4px;
}

.fee-head b,
.sku-line-head b {
  color: var(--red);
  font-weight: 800;
}

.required-cell {
  position: relative;
}

.required-cell::before {
  content: "*";
  position: absolute;
  top: 2px;
  left: 4px;
  z-index: 1;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.required-cell input,
.required-cell select {
  padding-left: 14px;
}

.danger-text {
  color: var(--red);
  font-weight: 700;
  white-space: nowrap;
}

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

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-item {
  padding: 12px;
  border-radius: 12px;
  background: rgba(16, 20, 26, 0.03);
}

.mini-item strong {
  display: block;
  margin-bottom: 4px;
}

.mini-item span {
  font-size: 12px;
  color: #667188;
}

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

.partner-autofill-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.partner-autofill-card.is-missing {
  background: #fff7ed;
  border-color: rgba(245, 158, 11, 0.28);
}

.partner-autofill-title,
.partner-autofill-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.partner-autofill-title {
  margin-bottom: 10px;
}

.partner-autofill-title strong {
  font-size: 13px;
  color: var(--ink);
}

.partner-autofill-title span,
.partner-autofill-row span {
  font-size: 12px;
  color: var(--muted);
}

.partner-autofill-row {
  padding: 5px 0;
  border-top: 1px solid #eef2f7;
}

.partner-autofill-row strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.sku-summary-list,
.operation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sku-summary-row,
.operation-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 120px 100px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 12px;
}

.sku-summary-row span,
.operation-row span {
  color: var(--muted);
}

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

.operation-row > div:last-child {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  text-align: right;
}

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

.operation-row strong {
  margin-bottom: 4px;
  color: var(--ink);
}

.label-preview {
  width: min(100%, 560px);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
  padding: 24px 30px 28px;
  border: 2px solid #10141a;
  background: #fff;
  color: #10141a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.label-preview-heading {
  display: none;
}

.label-preview-heading span,
.label-preview-meta {
  color: #667085;
  font-size: 12px;
}

.label-preview-title {
  min-height: 64px;
  text-align: center;
  color: #10141a;
  font-size: clamp(30px, 5.2vw, 58px);
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.label-preview-top {
  display: grid;
  grid-template-columns: 124px 1fr 142px;
  align-items: start;
  gap: 18px;
}

.label-split-box {
  grid-column: 3;
  width: 142px;
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #10141a;
  border-radius: 6px;
  font-size: 68px;
  line-height: 1;
  font-weight: 400;
}

.label-preview-code {
  margin: 6px 8px 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.label-preview-code > div {
  width: 100%;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 62px !important;
  border-radius: 0 !important;
  background: #fff !important;
}

.label-preview-meta {
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
}

.label-preview-fields {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px 18px;
  margin-top: auto;
  color: #10141a;
  font-size: 20px;
  line-height: 1.3;
}

.label-field-name {
  color: #ef4444;
  font-weight: 500;
}

.label-field-value {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.label-preview-footer {
  display: none;
}

.preview-qr {
  width: 124px;
  height: 124px;
  border: 8px solid #10141a;
  background:
    linear-gradient(90deg, #10141a 20%, transparent 20% 40%, #10141a 40% 60%, transparent 60% 80%, #10141a 80%),
    linear-gradient(#10141a 20%, transparent 20% 40%, #10141a 40% 60%, transparent 60% 80%, #10141a 80%);
  background-size: 36px 36px;
}

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

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-section {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fafcff;
}

.detail-section-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-section-hd strong {
  font-size: 13px;
  color: var(--ink);
}

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

.detail-grid {
  display: grid;
  gap: 12px;
}

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

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

.shipment-detail-page {
  max-width: 1180px;
}

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

.shipment-summary-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 96px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.shipment-summary-item span,
.shipment-summary-item small {
  color: var(--muted);
  font-size: 12px;
}

.shipment-summary-item strong {
  font-size: 24px;
  line-height: 1.1;
}

.shipment-progress-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.shipment-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e7edf5;
  overflow: hidden;
}

.shipment-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #7ef0c2);
}

.shipment-stage-list {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.shipment-stage-item {
  position: relative;
  min-height: 60px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.shipment-stage-item strong {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.shipment-stage-item.done {
  border-color: rgba(18, 185, 129, 0.24);
  background: #f1fbf7;
}

.shipment-stage-item.done strong,
.shipment-stage-item.active strong {
  color: var(--ink);
}

.shipment-stage-item.active {
  border-color: rgba(61, 107, 255, 0.32);
  background: #f4f7ff;
}

.shipment-stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
}

.shipment-stage-item.done .shipment-stage-dot {
  background: var(--green);
}

.shipment-stage-item.active .shipment-stage-dot {
  background: var(--blue);
}

.shipment-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shipment-log-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) 92px minmax(180px, 1fr) minmax(0, 1.5fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.shipment-log-main strong,
.shipment-log-main span,
.shipment-log-meta span,
.shipment-log-summary {
  display: block;
}

.shipment-log-main strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.shipment-log-main span,
.shipment-log-meta span,
.shipment-log-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.shipment-log-meta span + span {
  margin-top: 4px;
}

.shipment-log-result {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.shipment-log-result.green {
  background: rgba(18, 185, 129, 0.12);
  color: #0f7d58;
}

.shipment-log-result.red {
  background: rgba(239, 68, 68, 0.12);
  color: #c53030;
}

.list-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 4px 0 14px;
  align-items: center;
}

.list-filter-bar input,
.list-filter-bar select {
  width: 100%;
  height: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 44px;
  outline: none;
}

.list-filter-bar input::placeholder {
  color: #8a94a6;
  font-weight: 600;
  opacity: 1;
}

.list-filter-bar select {
  min-width: 0;
  appearance: auto;
}

.list-filter-bar input[type="date"] {
  color-scheme: light;
}

.date-filter-field,
.date-range-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.date-filter-field span,
.date-range-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.date-filter-field select,
.date-range-field input {
  min-width: 0;
}

.filter-summary {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.list-filter-bar .btn.small {
  height: 44px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
  line-height: 44px;
  justify-self: start;
}

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

.shipment-action-tile {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: 0.18s ease;
  cursor: pointer;
}

.shipment-action-tile strong {
  font-size: 14px;
  line-height: 1.35;
}

.shipment-action-tile span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.shipment-action-tile.is-active:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 107, 255, 0.35);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.shipment-action-tile.is-disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.field input.is-locked {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
}

.sku-line-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: auto;
}

.sku-line-head,
.sku-line-row {
  display: grid;
  grid-template-columns: 130px 190px 120px 130px 140px 110px 80px;
  gap: 10px;
  align-items: center;
  min-width: 960px;
}

.sku-line-head {
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sku-line-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.sku-line-row input,
.sku-line-row select {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

.sku-line-row input[readonly] {
  color: var(--muted);
  background: #f9fafb;
}

.action-section {
  background: linear-gradient(180deg, #ffffff, #f9fbff);
}

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

.action-tile {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: 0.18s ease;
}

.action-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 107, 255, 0.35);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.action-tile strong {
  font-size: 14px;
  line-height: 1.35;
}

.action-tile span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  min-height: 16px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.field label.is-required span {
  color: #ef4444;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-box input:focus {
  border-color: rgba(61, 107, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(61, 107, 255, 0.08);
}

.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  margin-top: 12px;
}

.panel {
  background: rgba(246, 247, 249, 0.98);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(16, 20, 26, 0.08);
}

.panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flow-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(16, 20, 26, 0.03);
}

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

.flow-line small {
  color: #6f7a8b;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(16, 20, 26, 0.08);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ef0c2, #7aa7ff);
}

.drawer {
  background: rgba(246, 247, 249, 0.98);
}

.empty-state {
  padding: 18px 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.shipment-modal {
  width: min(960px, 100%);
  max-height: min(86vh, 880px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 22px;
  background: #fff;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 22px;
  overflow: auto;
  background: #f8fafc;
}

.modal-body .detail-section {
  background: #fff;
  border-radius: 16px;
}

.modal-foot {
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

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

.import-upload-row {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.import-upload-row input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px dashed #cfd8e6;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

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

.import-summary > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

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

.import-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
}

.import-preview-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.import-preview-table .table {
  min-width: 820px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

@media (max-width: 1360px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .app-shell.is-dashboard {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .app-shell.is-dashboard {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .grid-kpi,
  .content-grid,
  .detail-grid.cols-2,
  .detail-grid.cols-3,
  .docs-source-summary,
  .alert-stat-grid,
  .alert-tracking-card,
  .action-grid,
  .shipment-stage-list,
  .list-filter-bar,
    .alert-mini {
    grid-template-columns: 1fr;
  }

  .shipment-log-row {
    grid-template-columns: 1fr;
  }

  .sku-summary-row,
  .operation-row,
  .partner-autofill-grid,
  .fee-breakdown-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .operation-row > div:last-child {
    justify-content: flex-start;
    text-align: left;
  }

  .label-preview-fields {
    grid-template-columns: 1fr;
  }

  .mapping-detail-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .mapping-detail-row {
    grid-template-columns: minmax(140px, 1fr) 120px 72px;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: end;
  }

  .shipment-modal {
    max-height: 92vh;
    border-radius: 18px;
  }

  .table-card {
    max-height: calc(100vh - 128px);
  }

  .permission-home-grid,
  .permission-stat-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .table-scroll {
    max-height: min(60vh, 620px);
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .detail-header-actions,
  .row-actions,
  .action-row,
  .modal-foot {
    gap: 8px;
  }

  .topbar {
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .search-box {
    flex: 1;
    min-width: 180px;
  }
}

@media (max-width: 640px) {
  .detail-header-actions,
  .row-actions,
  .action-row,
  .modal-foot {
    width: 100%;
    justify-content: flex-start;
  }

  .detail-header-actions .btn,
  .detail-header-actions .role-select,
  .row-actions .btn,
  .row-actions .role-select,
  .row-actions .docs-type-filter,
  .row-actions .docs-shipment-select,
  .action-row .btn,
  .modal-foot .btn {
    flex: 1 1 160px;
  }

  .modal-head {
    align-items: flex-start;
  }

  .mapping-detail-grid,
  .mapping-detail-row {
    grid-template-columns: 1fr;
  }

  .permission-home-grid,
  .permission-stat-grid {
    grid-template-columns: 1fr;
  }
}
