﻿:root {
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #172026;
  background: #eef1f4;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

button {
  border: 0;
  border-radius: 6px;
  background: #176b87;
  color: white;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button:hover {
  background: #12566c;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #e7edf1, #f7f2eb);
}

.login-panel {
  width: min(420px, 100%);
  background: white;
  border: 1px solid #d7dde2;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(20, 34, 45, 0.12);
}

.login-panel h1, .sidebar h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-panel p {
  margin: 0 0 22px;
  color: #66737d;
}

label {
  display: grid;
  gap: 7px;
  color: #33424c;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd3d9;
  border-radius: 6px;
  background: white;
  color: #172026;
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

#loginForm {
  display: grid;
  gap: 14px;
}

.remember-login {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #3b4a54;
}

.remember-login input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.hint {
  margin-top: 14px;
  color: #6d7780;
  font-size: 13px;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
}

.sidebar {
  background: #22313a;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#sidebarToggle {
  min-width: 34px;
  min-height: 32px;
  padding: 0;
  background: #31434e;
  position: relative;
  font-size: 0;
}

#sidebarToggle::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 10px;
  height: 2px;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: 0 5px 0 #ffffff, 0 10px 0 #ffffff;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 64px 1fr;
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 14px 10px;
}

.app-shell.sidebar-collapsed .sidebar h1,
.app-shell.sidebar-collapsed .user-box {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-head {
  justify-content: center;
}

.app-shell.sidebar-collapsed #sidebarToggle {
  width: 38px;
  min-width: 38px;
}

.app-shell.sidebar-collapsed .nav {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.app-shell.sidebar-collapsed .nav::before {
  content: attr(data-icon);
  font-size: 14px;
  font-weight: 700;
}

.app-shell.sidebar-collapsed .admin-submenu,
.app-shell.sidebar-collapsed .report-submenu,
.app-shell.sidebar-collapsed .todo-submenu,
.app-shell.sidebar-collapsed .inventory-submenu,
.app-shell.sidebar-collapsed .data-submenu,
.app-shell.sidebar-collapsed .tools-submenu,
.app-shell.sidebar-collapsed .system-log-submenu {
  padding-left: 0;
  gap: 8px;
}

.nav {
  background: transparent;
  color: #dbe5ea;
  text-align: left;
}

.nav.active {
  background: #176b87;
  color: white;
}

.admin-submenu,
.report-submenu,
.todo-submenu,
.inventory-submenu,
.data-submenu,
.tools-submenu,
.system-log-submenu {
  display: grid;
  gap: 6px;
  padding-left: 12px;
}

.app-shell.sidebar-collapsed .admin-submenu,
.app-shell.sidebar-collapsed .report-submenu,
.app-shell.sidebar-collapsed .todo-submenu,
.app-shell.sidebar-collapsed .inventory-submenu,
.app-shell.sidebar-collapsed .data-submenu,
.app-shell.sidebar-collapsed .tools-submenu,
.app-shell.sidebar-collapsed .system-log-submenu {
  display: none !important;
}

.sub-nav {
  min-height: 32px;
  font-size: 13px;
}

.user-box {
  margin-top: auto;
  display: grid;
  gap: 10px;
  color: #dbe5ea;
}

.content {
  height: 100vh;
  min-width: 0;
  padding: 22px;
  overflow: auto;
}

#ordersView {
  height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#ordersView .table-wrap {
  flex: 1;
  max-height: none;
}

.filter-panel {
  container-type: inline-size;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: end;
  position: relative;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #cfd7de;
  border-left: 4px solid #176b87;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 34, 45, 0.06);
}

.filter-panel label:nth-child(5) {
  padding-left: 18px;
  border-left: 1px solid #dfe5ea;
}

.filter-panel label:nth-child(7) {
  padding-left: 18px;
  border-left: 1px solid #dfe5ea;
}

.filter-panel label {
  gap: 4px;
  font-size: 11px;
  color: #40515c;
  font-weight: 700;
  flex: 0 1 128px;
  min-width: 78px;
}

.filter-panel label:nth-child(1),
.filter-panel label:nth-child(2),
.filter-panel label:nth-child(3),
.filter-panel label:nth-child(4) {
  flex: 0 0 154px;
  min-width: 154px;
}

.filter-panel label:nth-child(5) {
  flex-basis: 108px;
  min-width: 108px;
}

.filter-panel label:nth-child(6) {
  flex-basis: 84px;
}

.filter-panel label:nth-child(7) {
  flex-basis: 110px;
}

.filter-panel label:nth-child(8) {
  flex-basis: 132px;
}

.filter-panel label:nth-child(9) {
  flex-basis: 142px;
}

.filter-panel label:nth-child(10) {
  flex-basis: 118px;
}

.filter-panel input,
.filter-panel select,
.filter-panel button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.filter-panel label:not(:has(button)) {
  position: relative;
  padding-top: 1px;
}

.filter-label-title {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 21px;
  padding: 1px 8px;
  background: #f8fafc;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1em;
  line-height: 1.2;
  text-indent: 1em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.filter-panel label:nth-child(1) .filter-label-title,
.filter-panel label:nth-child(2) .filter-label-title,
.filter-panel label:nth-child(3) .filter-label-title,
.filter-panel label:nth-child(4) .filter-label-title {
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
}

.filter-panel label:nth-child(1) .filter-label-title,
.filter-panel label:nth-child(2) .filter-label-title {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}

.filter-panel label:nth-child(3) .filter-label-title,
.filter-panel label:nth-child(4) .filter-label-title {
  background: #ecfeff;
  border-color: #67e8f9;
  color: #155e75;
}

.filter-panel label:nth-child(5) .filter-label-title {
  background: #f3e8ff;
  border-color: #c084fc;
  color: #581c87;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
}

.filter-panel label:nth-child(6) .filter-label-title {
  background: #ffedd5;
  border-color: #fdba74;
  color: #7c2d12;
}

.filter-panel label:nth-child(7) .filter-label-title {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.filter-panel label:nth-child(8) .filter-label-title {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #134e4a;
}

.filter-panel label:nth-child(9) .filter-label-title {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #312e81;
}

.filter-panel label:nth-child(10) .filter-label-title {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #713f12;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}

#filterTrackingNumber {
  width: 132px;
}

.filter-panel label > input,
.filter-panel label > select {
  border: 1px solid #c5d1da;
  background: #ffffff;
}

.filter-panel input[type="date"] {
  padding-left: 8px;
  padding-right: 7px;
  font-size: 12px;
}

.filter-panel label:focus-within {
  color: #0f5c76;
}

.filter-panel label:focus-within > input,
.filter-panel label:focus-within > select {
  border-color: #176b87;
  box-shadow: 0 0 0 2px rgba(23, 107, 135, 0.12);
}

.filter-panel button {
  padding: 0 10px;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex: 0 1 auto;
  flex-wrap: wrap;
  white-space: nowrap;
  padding-left: 18px;
  border-left: 1px solid #dfe5ea;
}

.filter-actions button {
  flex: 0 0 auto;
}

#addOrderButton,
#syncAllInventoryButton {
  background: #9a6b3f;
}

#addOrderButton:hover,
#syncAllInventoryButton:hover {
  background: #7f5732;
}

#syncCostPriceButton {
  background: #59657f;
}

#syncCostPriceButton:hover {
  background: #46516a;
}

#syncCostPriceButton.is-running,
#syncCostPriceButton:disabled {
  background: #8f98aa;
  color: #eef2f5;
  cursor: not-allowed;
}

.sync-status-area {
  position: static;
  display: flex;
  flex: 1 1 260px;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px;
  width: auto;
  max-width: 390px;
  min-width: 0;
  margin-left: auto;
}

.sync-status-card {
  flex: 1 1 0;
  min-width: 96px;
  max-width: none;
  width: 100%;
  padding: 3px 5px;
  border: 1px solid #d8e4ec;
  border-radius: 6px;
  box-sizing: border-box;
  text-align: right;
  color: #60707b;
  font-size: 10px;
  line-height: 1.15;
  overflow: hidden;
}

.inventory-sync-status {
  background: #f4f8fb;
}

.cost-sync-status {
  background: #f7f5fb;
  border-color: #ded8ed;
}

.sync-status-card span,
.sync-status-card b {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.sync-status-card b {
  margin-top: 2px;
  color: #33424c;
  font-weight: 600;
}

.sync-status-card small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: #52616b;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.sync-status-card em {
  font-style: normal;
  white-space: normal;
  overflow-wrap: anywhere;
}

@container (max-width: 1580px) {
  .sync-status-area {
    display: none;
  }

  .filter-actions {
    margin-left: auto;
  }
}

@media (max-width: 1850px) {
  #ordersView .sync-status-area {
    display: none;
  }
}

.inventory-sync-progress {
  width: min(760px, 100%);
  margin: -4px 0 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #d4dde4;
  border-left: 4px solid #176b87;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(20, 34, 45, 0.05);
}

.sync-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #33424c;
  font-size: 13px;
}

.sync-progress-head b {
  color: #176b87;
  font-weight: 700;
  white-space: nowrap;
}

.sync-progress-track {
  height: 8px;
  overflow: hidden;
  background: #e8eef2;
  border-radius: 999px;
}

.sync-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #176b87, #31a7c8);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.column-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 6px;
  color: #52606a;
  font-size: 12px;
  min-width: 0;
}

.column-tools label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
}

.column-tools input {
  width: auto;
  min-height: auto;
  padding: 0;
}

.batch-status-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 620px;
  flex-wrap: wrap;
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid #cfd8df;
}

.order-color-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px 8px;
  flex: 1 1 390px;
  flex-wrap: wrap;
  min-width: 0;
  margin-left: 0;
  color: #b42318;
  font-size: 11px;
  white-space: normal;
  overflow: hidden;
}

.order-list-settings-save {
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 28px;
  padding: 5px 12px;
  border: 0;
  border-radius: 5px;
  background: #176b87;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.order-list-settings-save:hover:not(:disabled) {
  background: #125a72;
}

.order-list-settings-save:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.order-color-legend span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.legend-swatch {
  display: inline-block;
  width: 22px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 2px;
}

.legend-stock {
  width: auto;
  min-width: 58px;
  height: 16px;
  padding: 0 4px;
  background: #fff7df;
  color: #9a6400;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.legend-ready {
  background: #edf9f1;
}

.legend-partial {
  background: #fff9e8;
}

.legend-loss {
  background: #fff4f1;
}

.legend-delivered {
  background: #edf5ff;
}

.batch-status-tools select {
  width: 86px;
  min-height: 26px;
  padding: 3px 6px;
  font-size: 12px;
}

.batch-status-tools button {
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.batch-status-tools select:disabled,
.batch-status-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.orders-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: auto;
  margin: 0 0 6px;
  padding: 6px;
  background: linear-gradient(180deg, #ffffff, #f8fafb);
  border: 1px solid #cfd7de;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 34, 45, 0.05);
}

.orders-summary span {
  display: grid;
  gap: 1px;
  min-width: 118px;
  padding: 5px 8px;
  background: #ffffff;
  border: 1px solid #e1e7ec;
  border-radius: 6px;
  color: #20313b;
  font-size: 13px;
  font-weight: 700;
}

.orders-summary b {
  color: #64727c;
  font-weight: 600;
  font-size: 11px;
}

.orders-summary .summary-profit {
  border-color: #d6e5dc;
  background: #f6fbf8;
}

.orders-summary .summary-profit.positive {
  color: #176236;
}

.orders-summary .summary-profit.negative {
  color: #b42318;
  border-color: #f0c9c2;
  background: #fff5f3;
}

.orders-summary .summary-restricted {
  color: #7b8791;
}

.table-wrap {
  background: white;
  border: 1px solid #c9d3da;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 255px);
  min-height: 320px;
  position: relative;
  box-shadow: inset 0 0 0 1px #e5ebef;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
}

#ordersView #ordersTable {
  min-width: 2300px;
}

th, td {
  border: 1px solid #dfe5ea;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

td[data-column="barcode"],
td[data-column="product"],
td[data-column="quantity"],
td[data-column="shipPrice"],
td[data-column="supplier"],
td[data-column="arrivalPrice"],
td[data-column="stockCostPrice"],
td[data-column="shippingFee"],
td[data-column="profit"],
td[data-column="stockQty"],
td[data-column="trackingNumber"] {
  vertical-align: middle;
}

td[data-column="quantity"],
td[data-column="shipPrice"],
td[data-column="arrivalPrice"],
td[data-column="stockCostPrice"],
td[data-column="shippingFee"],
td[data-column="profit"],
td[data-column="stockQty"] {
  text-align: right;
}

td[data-column="quantity"] {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.select-column {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  text-align: center;
  vertical-align: middle;
  padding: 6px 4px;
}

#ordersTable col[data-column="select"],
#ordersTable th[data-column="select"],
#ordersTable td[data-column="select"] {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  flex: 0 0 36px;
}

.select-column input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}

th:last-child, td:last-child {
  border-right: 1px solid #dfe5ea;
}

th {
  background: #eef3f6;
  color: #46545e;
  position: sticky;
  top: -1px;
  user-select: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  z-index: 20;
  border-top: 1px solid #c8d2d9;
  border-bottom: 1px solid #9aacb8;
  box-shadow: inset 0 -3px 0 #8fa2af, 0 4px 8px rgba(20, 34, 45, 0.18);
}

th::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -3px;
  height: 4px;
  background: #eef3f6;
  border-top: 1px solid #c8d2d9;
  z-index: -1;
}

th .resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

th .resize-handle:hover {
  background: rgba(23, 107, 135, 0.2);
}

.column-hidden {
  display: none !important;
}

col.column-hidden {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  visibility: collapse;
}

td[data-column="note"] {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.inline-order-note {
  display: none;
}

body.liu-kaiqiang-order-view .inline-order-note {
  display: block;
  margin-top: 6px;
  padding-left: 10px;
  border-left: 3px solid #9cc8de;
  color: #51616c;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.liu-kaiqiang-order-view .inline-order-note b {
  color: #176b87;
  font-weight: 700;
  margin-right: 2px;
}

body.liu-kaiqiang-order-view #ordersTable th,
body.liu-kaiqiang-order-view #ordersTable td {
  padding-left: 5px;
  padding-right: 5px;
  font-size: 12px;
}

body.liu-kaiqiang-order-view #ordersTable td[data-column="customer"] {
  white-space: normal;
  overflow-wrap: anywhere;
}

body.liu-kaiqiang-order-view #ordersView .table-wrap {
  overflow-x: hidden;
}

body.liu-kaiqiang-order-view #ordersTable .stock-cell {
  padding-right: 5px;
}

body.liu-kaiqiang-order-view #ordersTable .stock-cell-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

body.liu-kaiqiang-order-view #ordersTable .stock-cell-inner span {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  text-align: right;
}

body.liu-kaiqiang-order-view #ordersTable .stock-cell-inner .stock-refresh-button {
  position: static;
  transform: none;
  flex: 0 0 22px;
}

.profit-cell {
  cursor: help;
  text-decoration: underline dotted rgba(23, 107, 135, 0.45);
  text-underline-offset: 3px;
}

.stock-cell {
  position: relative;
  white-space: nowrap;
  padding-right: 34px;
}

.stock-cell span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.stock-refresh-button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-width: 22px;
  width: 22px;
  min-height: 22px;
  height: 22px;
  flex: 0 0 22px;
  padding: 0;
  margin-left: 0;
  border-radius: 999px;
  background: #e9f3f6;
  color: #176b87;
  font-size: 13px;
  line-height: 1;
  vertical-align: middle;
}

.stock-refresh-button:hover {
  background: #d5ebf1;
}

.stock-refresh-button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.stock-usage-marker {
  display: inline-block;
  margin-left: 4px;
  color: #b77900;
  font-size: 15px;
  font-weight: 800;
  cursor: help;
  vertical-align: middle;
}

.shared-shipping-marker {
  display: inline-block;
  margin-left: 3px;
  color: #b36b00;
  cursor: help;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.order-merged {
  vertical-align: middle;
  background-clip: padding-box;
  border-bottom: 2px solid #d8dee3;
}

tbody tr:has(.order-merged) td {
  border-top: 2px solid #d8dee3;
}

tr.order-group-end td {
  border-bottom: 2px solid #d8dee3;
}

.order-ready-row td {
  background: #edf9f1;
}

.order-partial-row td {
  background: #fff9e8;
}

.order-delivered-row td {
  background: #edf5ff;
}

.order-ready-row.item-not-ready-row td:not(.order-merged) {
  background: #ffffff;
}

.order-ready-row.order-negative-row td,
.order-partial-row.order-negative-row td,
.order-delivered-row.order-negative-row td {
  background: #fff1ef;
}

.quantity-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 82px;
  line-height: 1.15;
}

.quantity-progress b {
  font-weight: 700;
}

.quantity-progress small {
  color: #64748b;
  font-size: 11px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.quantity-progress em {
  color: #7b8790;
  font-size: 11px;
  font-style: normal;
  white-space: normal;
}

.quantity-progress em.active {
  color: #9a6400;
  font-weight: 700;
}

.order-negative-row td {
  background: #fff4f1;
}

.order-negative-row:hover td {
  background: #ffede8;
}

.order-negative-row .profit-cell {
  color: #b42318;
  font-weight: 800;
}

th.sortable {
  cursor: pointer;
  padding-right: 18px;
}

th.sortable::after {
  content: "↕";
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa6ad;
  font-size: 11px;
  line-height: 1;
  z-index: 2;
}

th.sortable.sort-asc::after {
  content: "↑";
  color: #176b87;
}

th.sortable.sort-desc::after {
  content: "↓";
  color: #176b87;
}

th[data-column="note"] {
  white-space: nowrap;
}

.row-actions {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.row-actions-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.row-actions button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  margin: 0;
  vertical-align: middle;
}

.row-actions button:last-child {
  margin-right: 0;
}

.danger {
  background: #b93a3a;
}

.danger:hover {
  background: #922f2f;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 13px;
  background: #e7edf1;
}

.status.pending {
  background: #edf1f5;
  color: #334155;
}

.status.ready {
  background: #dbf4e5;
  color: #176236;
}

.status.partial {
  background: #fff0c7;
  color: #8a5a00;
}

.status.done {
  background: #dce9ff;
  color: #1f4e93;
}

.status.cancel {
  background: #f4dddd;
  color: #953333;
}

.order-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

.delivery-type-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 110px;
}

.tax-rate-unconfirmed-warning {
  color: #b42318;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.delivery-method-delivery {
  background: #e8f3f7;
  color: #176b87;
}

.delivery-method-mail {
  background: #f5ebdc;
  color: #8a5a18;
}

.delivery-method-pickup {
  background: #eee8f8;
  color: #694292;
}

.delivery-type-domestic {
  background: #edf7e8;
  color: #3f6d23;
}

.delivery-type-r1_export,
.delivery-type-export {
  background: #ece9fb;
  color: #51408a;
}

.delivery-type-r1_domestic {
  background: #e6f3f7;
  color: #246278;
}

.delivery-type-combined {
  background: #fff0d8;
  color: #8a5218;
}

.status-select {
  width: 92px;
  min-width: 92px;
  min-height: 26px;
  box-sizing: border-box;
  border: 0;
  border-radius: 999px;
  padding: 2px 16px 2px 7px;
  font-size: 13px;
  background-color: #e7edf1;
  color: #172026;
  cursor: pointer;
}

.status-select.pending {
  background-color: #edf1f5;
  color: #334155;
}

.inline-shipping-fee {
  width: 76px;
  min-width: 70px;
  min-height: 26px;
  padding: 2px 7px;
  border: 1px solid #c9d7df;
  border-radius: 4px;
  background: #ffffff;
  color: #172026;
  font-size: 13px;
  text-align: right;
}

.inline-shipping-fee:focus {
  outline: 2px solid rgba(23, 107, 135, 0.18);
  border-color: #176b87;
}

.inline-shipping-fee:disabled {
  background: #eef2f5;
  color: #7b8790;
  cursor: not-allowed;
}

.inline-shipping-fee.input-missing,
.inline-tracking-number.input-missing {
  background: #fff1f1;
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.inline-tracking-number {
  width: 118px;
  min-width: 108px;
  display: block;
  margin: 0 auto;
  min-height: 26px;
  padding: 2px 7px;
  border: 1px solid #c9d7df;
  border-radius: 4px;
  background: #ffffff;
  color: #172026;
  font-size: 13px;
  text-align: center;
}

.inline-tracking-number:focus {
  outline: 2px solid rgba(23, 107, 135, 0.18);
  border-color: #176b87;
}

.inline-tracking-number:disabled {
  background: #eef2f5;
  color: #7b8790;
  cursor: not-allowed;
}

.shipping-record-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
}

td[data-column="trackingNumber"] {
  text-align: center;
}

td[data-column="trackingNumber"] .shipping-record-cell {
  align-items: center;
}

td[data-column="trackingNumber"] .shipping-record-list {
  width: 100%;
  align-items: center;
}

td[data-column="trackingNumber"] .shipping-record-line {
  width: 100%;
  text-align: center;
}

.shipping-record-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}

.shipping-record-line {
  color: #1f3f50;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}

.shipping-record-line + .shipping-record-line {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #bfd0da;
}

.shipping-record-line-with-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.shipping-record-delete {
  min-height: 20px;
  min-width: 24px;
  padding: 0 5px;
  border-radius: 4px;
  background: #c33a3a;
  color: #ffffff;
  font-size: 11px;
}

td[data-column="status"] {
  overflow: visible;
  text-overflow: clip;
}

.status-select.ready {
  background-color: #dbf4e5;
  color: #176236;
}

.status-select.partial {
  background-color: #fff0c7;
  color: #8a5a00;
}

.status-select.done {
  background-color: #dce9ff;
  color: #1f4e93;
}

.export-calc-layout {
  display: grid;
  grid-template-columns: minmax(1180px, 1fr) max-content;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.export-calc-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.export-calc-panel,
.export-result-panel,
.export-rate-panel {
  background: #ffffff;
  border: 1px solid #d3dde3;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 34, 45, 0.05);
  padding: 12px;
}

.export-calc-panel h2,
.export-result-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.export-calc-panel p {
  margin: 0 0 10px;
  color: #6a7780;
  font-size: 13px;
}

.export-calc-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  column-gap: 12px;
  row-gap: 18px;
}

.export-dimension-field {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border: 1px solid #d9e1e6;
  border-radius: 8px;
  margin: 0;
  padding: 6px 8px 8px;
}

.export-dimension-field.compact {
  grid-column: auto;
  display: grid;
}

.export-dimension-field legend {
  padding: 0 6px;
  color: #33424c;
  font-size: 14px;
}

.export-weight-group,
.export-size-group {
  display: grid;
  gap: 12px;
  border: 1px solid #d8e1d5;
  border-radius: 8px;
  margin: 0;
  padding: 5px 9px 7px;
  background: rgba(255, 255, 255, 0.65);
}

.export-weight-group {
  grid-column: span 2;
  grid-template-columns: minmax(210px, 1fr) minmax(120px, 0.7fr);
  background: #f3f8f0;
  align-items: start;
  min-height: 0;
}

.export-size-group {
  grid-column: span 3;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  background: #f3f8f0;
  align-items: start;
  min-height: 0;
}

.export-weight-group > legend,
.export-size-group > legend {
  padding: 0 6px;
  color: #33424c;
  font-size: 14px;
}

.export-weight-unit-radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: #33424c;
  font-size: 12px;
  font-weight: 400;
}

.export-weight-unit-radio label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
}

.export-weight-unit-radio input {
  width: auto;
  margin: 0;
}

.export-weight-field {
  display: grid;
  grid-template-rows: 22px 30px;
  gap: 4px;
  align-content: start;
}

.export-field-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.export-weight-group input,
.export-size-group input {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.export-size-group .export-dimension-field.compact {
  grid-template-rows: 22px 30px;
  align-content: start;
  min-height: 0;
  padding-bottom: 5px;
}

.export-input-flash {
  animation: exportInputFlash 0.8s ease-out;
}

@keyframes exportInputFlash {
  0% {
    background: #fff0a6;
    border-color: #d49b25;
    box-shadow: 0 0 0 3px rgba(255, 208, 64, 0.45);
  }
  100% {
    background: #fff;
    border-color: #cbd6de;
    box-shadow: none;
  }
}

.export-size-group .export-dimension-field.compact legend {
  align-self: center;
}

.export-fixed-cost-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  border: 1px solid #d9e1e6;
  border-radius: 8px;
  margin: 0;
  padding: 6px 8px 8px;
  background: #f5f7f8;
}

.export-fixed-cost-field legend {
  padding: 0 6px;
  color: #33424c;
  font-size: 14px;
}

.export-calc-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.export-result-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-result-section {
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  padding: 8px;
}

.export-result-section h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.export-result-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}

.export-result-section.income {
  background: #eef9f1;
  border-color: #b7dfc0;
}

.export-result-section.expense {
  background: #fff0f0;
  border-color: #efc1c1;
}

.export-result-section.fixed {
  background: #fff7e8;
  border-color: #e4c588;
}

.export-result-section.neutral {
  background: #f6f9fb;
  border-color: #dbe3e8;
}

.export-result-card {
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafb;
}

.export-result-card.strong {
  background: #eaf6ef;
  border-color: #b9dfc7;
}

.export-result-card.shipping-total {
  grid-column: 1 / -1;
}

.export-result-card.income {
  background: #e5f5e9;
  border-color: #a9d9b5;
}

.export-result-card.expense {
  background: #fde8e8;
  border-color: #ebb0b0;
}

.export-result-card.fixed {
  background: #fff4dc;
  border-color: #e5c580;
}

.export-result-card.neutral {
  background: #f8fafb;
  border-color: #dbe3e8;
}

.export-result-card.warning {
  background: #fff7e8;
  border-color: #edd098;
}

.export-result-card span {
  display: block;
  color: #5b6872;
  font-size: 13px;
  margin-bottom: 4px;
}

.export-result-card b {
  display: block;
  color: #172026;
  font-size: 18px;
}

.export-result-grid.export-result-flash .export-result-card b {
  animation: exportPriceFlash 0.9s ease-out;
}

@keyframes exportPriceFlash {
  0% {
    background: #fff0a6;
    color: #9a3b00;
    box-shadow: 0 0 0 4px rgba(255, 208, 64, 0.35);
  }
  100% {
    background: transparent;
    color: #172026;
    box-shadow: none;
  }
}

.export-result-card small {
  display: block;
  margin-top: 4px;
  color: #697782;
  font-size: 12px;
}

.export-rate-panel {
  width: 560px;
  max-width: 560px;
  margin-top: 0;
  padding: 0;
  overflow: hidden;
}

.export-rate-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #edf4f7, #fbfcfd);
  border-bottom: 1px solid #dbe3e8;
}

.export-rate-head h2 {
  margin: 0;
  font-size: 18px;
}

.export-rate-head span {
  color: #687782;
  font-size: 13px;
}

.export-rate-table {
  max-height: calc(100vh - 160px);
  min-height: 180px;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.export-rate-table table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 13px;
}

.export-rate-table th,
.export-rate-table td {
  border-right: 1px solid #dfe6eb;
  border-bottom: 1px solid #dfe6eb;
  padding: 7px 10px;
  text-align: right;
  background: #fff;
}

.export-rate-table th:first-child,
.export-rate-table td:first-child {
  text-align: center;
  width: 120px;
}

.export-rate-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4f7;
  color: #273640;
  border-bottom: 2px solid #95a9b5;
}

.export-rate-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.export-rate-table tbody tr.export-rate-highlight td {
  background: #fff3c4;
  color: #172026;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #d49b25;
}

.export-rate-table .empty-state {
  margin: 14px;
}

.container-calc-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1480px;
}

.container-calc-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 220px)) 1fr;
  gap: 12px;
  align-items: end;
}

.collapsible-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.collapsible-title h2,
.collapsible-title p {
  margin-left: 0;
}

.collapsible-section.is-collapsed .collapsible-content {
  display: none;
}

.section-toggle {
  min-width: 54px;
  padding: 6px 12px;
}

.container-calc-actions,
.container-items-head {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.container-items-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.container-items-head h2 {
  margin: 0;
  font-size: 18px;
}

.container-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.container-items-table {
  overflow-x: auto;
}

.container-items-table table,
.container-result-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.container-items-table th,
.container-items-table td,
.container-result-table th,
.container-result-table td {
  border-right: 1px solid #dfe6eb;
  border-bottom: 1px solid #dfe6eb;
  padding: 7px 8px;
  background: #fff;
  vertical-align: middle;
}

.container-items-table th,
.container-result-table th {
  background: #eef4f7;
  border-bottom: 2px solid #95a9b5;
  text-align: left;
}

.muted-profit {
  color: #7a8791;
  font-size: 12px;
  margin-left: 4px;
  white-space: nowrap;
}

.container-items-table input {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
}

.container-tax-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.container-tax-choice label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 30px;
  font-size: 12px;
}

.container-tax-choice input {
  width: auto;
  min-height: auto;
  padding: 0;
}

.container-size-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.smart-container-layout {
  max-width: none;
}

.smart-container-form {
  grid-template-columns: repeat(4, minmax(150px, 220px)) 1fr;
}

.smart-container-items-table {
  overflow-x: visible;
}

.smart-container-items-table th:nth-child(1) { width: 12%; }
.smart-container-items-table th:nth-child(2) { width: 22%; }
.smart-container-items-table th:nth-child(3) { width: 9%; }
.smart-container-items-table th:nth-child(4) { width: 9%; }
.smart-container-items-table th:nth-child(5) { width: 7%; }
.smart-container-items-table th:nth-child(6) { width: 8%; }
.smart-container-items-table th:nth-child(7) { width: 20%; }
.smart-container-items-table th:nth-child(8) { width: 8%; }
.smart-container-items-table th:nth-child(9) { width: 5%; }

.smart-priority-select {
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
}

.smart-result-summary {
  grid-template-columns: repeat(6, minmax(120px, 1fr)) minmax(280px, 2fr);
}

.smart-additional-result-card small {
  display: block;
  margin-top: 4px;
  color: #53636d;
  font-size: 12px;
  line-height: 1.35;
}

.smart-additional-result-card button {
  margin-top: 8px;
}

.smart-container-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid #d8e4ea;
  background: #f8fbfc;
}

.smart-container-tabs button:disabled {
  background: #176b87;
  color: #fff;
  opacity: 1;
}

.smart-container-badge {
  display: inline-block;
  margin: 1px 3px 1px 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dff3e8;
  color: #17663f;
  font-size: 12px;
  white-space: nowrap;
}

.smart-container-badge.active {
  background: #176b87;
  color: #fff;
}

.smart-freight-card {
  min-width: 190px;
}

.smart-freight-lines {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #d8e4ea;
}

.smart-freight-lines small {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #53636d;
}

.smart-freight-lines strong { color: #263c48; }
.smart-freight-lines em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-freight-lines i { color: #176b87; font-style: normal; font-weight: 700; white-space: nowrap; }

.smart-result-table tr.smart-current-loaded td { background: #f2fbf6; }
.smart-result-table tr.smart-current-unloaded td { background: #fff6f4; }

.smart-price-note {
  display: block;
  margin-top: 2px;
  color: #60717d;
  font-size: 10px;
  white-space: nowrap;
}

.smart-3d-section {
  margin-bottom: 12px;
  border: 1px solid #d8e4ea;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.smart-3d-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  background: #eef4f7;
  border-bottom: 1px solid #d8e4ea;
}

.smart-3d-head h3 {
  margin: 0;
  font-size: 16px;
}

.smart-3d-head span {
  color: #60717d;
  font-size: 12px;
}

.smart-3d-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.smart-3d-canvas {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 420px;
  background: #f7fafc;
}

.smart-3d-body {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(240px, 1fr);
  align-items: stretch;
}

.smart-3d-section:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.smart-3d-section:fullscreen .smart-3d-body {
  flex: 1;
  min-height: 0;
}

.smart-3d-section:fullscreen .smart-3d-legend {
  max-height: none;
}

.smart-3d-canvas canvas {
  display: block;
  width: 100%;
}

.smart-3d-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 3px;
  max-width: 360px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #fff;
  background: rgba(20, 32, 41, 0.92);
  pointer-events: none;
  font-size: 12px;
}

.smart-3d-tooltip b {
  font-size: 13px;
}

.smart-3d-legend {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  max-height: none;
  overflow: visible;
  padding: 12px;
  border-left: 1px solid #e4e9ed;
  font-size: 12px;
}

.smart-3d-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.35;
}

.smart-3d-legend i {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--legend-color);
}

@media (max-width: 900px) {
  .smart-3d-body { grid-template-columns: minmax(0, 3fr) minmax(190px, 1fr); }
  .smart-3d-head { align-items: flex-start; }
  .smart-3d-head-actions { flex-wrap: wrap; justify-content: flex-end; }
}

.smart-result-legend {
  display: flex;
  gap: 18px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.smart-result-legend .loaded,
.smart-loaded-count,
.smart-all-loaded {
  color: #157347;
}

.smart-result-legend .unloaded,
.smart-unloaded-count {
  color: #c33232;
}

.smart-loaded-count,
.smart-unloaded-count,
.smart-all-loaded {
  display: inline-block;
  min-width: 72px;
  padding: 3px 7px;
  border-radius: 5px;
  font-weight: 700;
  text-align: center;
}

.smart-loaded-count,
.smart-all-loaded {
  background: #e3f5e9;
}

.smart-unloaded-count {
  background: #fde4e4;
}

.smart-result-table td:nth-child(n + 3) {
  text-align: right;
}

.container-result-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.container-result-card {
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafb;
}

.container-result-card.good {
  background: #e5f5e9;
  border-color: #a9d9b5;
}

.container-result-card.bad {
  background: #fde8e8;
  border-color: #ebb0b0;
}

.container-result-card span {
  display: block;
  color: #5b6872;
  font-size: 13px;
}

.container-result-card b {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.container-fee-breakdown {
  border: 1px solid #d8e4ea;
  border-radius: 8px;
  background: #fff;
  margin: 0 0 12px;
  overflow: hidden;
}

.container-fee-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #eef4f7;
  border-bottom: 1px solid #d8e4ea;
}

.container-fee-head h3,
.container-fee-title h3 {
  margin: 0;
  font-size: 15px;
}

.container-fee-head span {
  color: #5b6872;
  font-size: 12px;
}

.container-fee-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.container-fee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.container-fee-section {
  border: 1px solid #dfe6eb;
  border-radius: 8px;
  overflow: hidden;
}

.container-fee-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafb;
  border-bottom: 1px solid #dfe6eb;
}

.container-fee-title strong {
  color: #0f5f74;
}

.container-fee-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(180px, 1.6fr) 100px;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid #edf1f4;
  font-size: 13px;
}

.container-fee-row:last-child {
  border-bottom: 0;
}

.container-fee-row b {
  text-align: right;
}

.container-fee-row small {
  color: #6b7780;
  text-align: left;
}

@media (max-width: 1200px) {
  .export-calc-layout {
    grid-template-columns: 1fr;
  }

  .container-calc-form {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .container-fee-grid {
    grid-template-columns: 1fr;
  }

  .smart-result-summary {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

.status-select.cancel {
  background-color: #f4dddd;
  color: #953333;
}

.status-select option,
.status-option {
  font-weight: 700;
}

.status-select option.pending,
.status-option.pending {
  background-color: #edf1f5;
  color: #334155;
}

.status-select option.ready,
.status-option.ready {
  background-color: #dbf4e5;
  color: #176236;
}

.status-select option.partial,
.status-option.partial {
  background-color: #fff0c7;
  color: #8a5a00;
}

.status-select option.done,
.status-option.done {
  background-color: #dce9ff;
  color: #1f4e93;
}

.status-select option.cancel,
.status-option.cancel {
  background-color: #f4dddd;
  color: #953333;
}

.status-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

button:disabled,
.row-actions button:disabled {
  background: #c8d1d8;
  color: #6b7780;
  cursor: not-allowed;
  opacity: 0.75;
}

.form-grid {
  width: min(1880px, 100%);
  max-width: 1880px;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  background: white;
  border: 1px solid #d8dee3;
  border-radius: 8px;
  padding: 18px;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
}

#orderForm.operations-shipping-edit-mode .order-basic-section,
#orderForm.operations-shipping-edit-mode .order-items-editor,
#orderForm.operations-shipping-edit-mode .order-note-section {
  opacity: 0.62;
}

#orderForm.operations-shipping-edit-mode .order-shipping-section {
  border-color: #1d819d;
  box-shadow: 0 0 0 2px rgba(29, 129, 157, 0.14);
}

#newOrderView.copy-order-modal-mode {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: block !important;
  overflow: auto;
  padding: 28px;
  background: rgba(18, 31, 40, 0.55);
}

#newOrderView.copy-order-modal-mode #orderForm {
  width: min(1940px, calc(100vw - 56px));
  max-width: 1940px;
  margin: 0 auto;
  padding: 18px;
  border-radius: 10px;
  background: #f7f9fa;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
}

#newOrderView.copy-order-modal-mode #orderForm .item-table-wrap {
  overflow-x: auto;
  padding-right: 10px;
  padding-left: 10px;
}

#newOrderView.copy-order-modal-mode #orderForm .item-table {
  width: 1860px;
  min-width: 1860px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.order-form-section,
.order-items-editor {
  position: relative;
  overflow: hidden;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(20, 34, 45, 0.05);
}

.order-form-section h3,
.order-items-editor .section-title {
  margin: 0;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #dfe7ed;
  color: #20313b;
  font-size: 15px;
  font-weight: 800;
}

.order-form-section h3::before,
.order-items-editor .section-title::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 4px;
  height: 22px;
  border-radius: 999px;
}

.order-basic-section {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 0;
  border-color: #c8dce5;
}

.order-basic-section h3 {
  grid-column: 1 / -1;
  background: linear-gradient(90deg, #e8f3f7, #f8fbfc);
}

.order-basic-section h3::before {
  background: #176b87;
}

.order-basic-section label {
  min-height: 74px;
  padding: 10px;
  border-right: 1px solid #e1e7ec;
  border-bottom: 1px solid #e1e7ec;
}

.order-basic-section .order-delivery-type-field {
  grid-column: 1;
}

.order-items-editor {
  border-color: #d6dfbd;
}

.order-shipping-section {
  border-color: #d7c7e8;
}

.order-shipping-section .section-title {
  margin: 0;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #e6dff0;
  background: linear-gradient(90deg, #f3edf8, #fcfbfd);
  color: #20313b;
  font-size: 15px;
  font-weight: 800;
}

.order-shipping-section .section-title::before {
  background: #7c5aa6;
}

.order-shipping-records-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.order-shipping-record-row {
  display: grid;
  grid-template-columns: 120px 180px auto;
  gap: 8px;
  align-items: end;
  width: fit-content;
}

.order-shipping-record-row label {
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #354956;
}

.order-shipping-record-row input {
  min-height: 30px;
  border-radius: 4px;
}

.order-items-editor .section-title {
  background: linear-gradient(90deg, #f0f5df, #fbfcf6);
}

.order-items-editor .section-title::before {
  background: #6b7f2a;
}

.order-note-section {
  border-color: #d3dde3;
}

.order-note-section h3 {
  background: linear-gradient(90deg, #edf2f5, #fbfcfd);
}

.order-note-section h3::before {
  background: #596d7a;
}

.order-note-section label {
  padding: 10px;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.order-item-stock-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a33131;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.order-item-stock-legend i {
  width: 13px;
  height: 13px;
  border: 1px solid #d95858;
  border-radius: 3px;
  background: #ffdede;
}

.bulk-discount-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #42525d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.bulk-discount-control input {
  width: 58px;
  min-height: 32px;
  padding: 4px 7px;
  text-align: right;
}

.bulk-tax-rate-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #42525d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.bulk-tax-rate-control select {
  width: 64px;
  min-height: 32px;
  padding: 4px 6px;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.order-items-editor {
  padding: 0;
  width: 100%;
}

.item-table-wrap {
  padding: 10px;
  overflow-x: hidden;
}

.item-table {
  width: min(1860px, 100%);
  min-width: 0;
  table-layout: fixed;
}

.item-table th:nth-child(1),
.item-table td:nth-child(1) {
  width: 58px;
  text-align: center;
}

.item-table th:nth-child(2),
.item-table td:nth-child(2) {
  width: 175px;
}

.item-table th:nth-child(3),
.item-table td:nth-child(3) {
  width: 520px;
}

.order-item-row td {
  vertical-align: middle;
}

.item-table th:nth-child(4),
.item-table td:nth-child(4) {
  width: 95px;
}

.item-table th:nth-child(5),
.item-table td:nth-child(5) {
  width: 90px;
}

.item-table th:nth-child(6),
.item-table td:nth-child(6) {
  width: 95px;
}

.item-table th:nth-child(7),
.item-table td:nth-child(7) {
  width: 175px;
}

.item-table th:nth-child(8),
.item-table td:nth-child(8) {
  width: 105px;
}

.item-table th:nth-child(9),
.item-table td:nth-child(9) {
  width: 150px;
}

.item-table th:nth-child(10),
.item-table td:nth-child(10) {
  width: 90px;
}

.item-table th:nth-child(11),
.item-table td:nth-child(11) {
  width: 86px;
}

.item-table th:nth-child(12),
.item-table td:nth-child(12) {
  width: 90px;
}

.item-table th:nth-child(13),
.item-table td:nth-child(13) {
  width: 132px;
  text-align: center;
}

.order-item-tax-rate {
  width: 100%;
  min-height: 32px;
  padding: 5px 6px;
}

.drag-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.discount-rate-input {
  display: flex;
  align-items: center;
  gap: 3px;
}

.discount-rate-input input {
  min-width: 0;
  text-align: right;
}

.discount-rate-input span {
  flex: 0 0 auto;
  color: #52616b;
}

.inline-discount-rate input {
  padding-right: 4px;
}

.order-item-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.order-item-actions .small-button {
  padding: 0 7px;
  white-space: nowrap;
}

.order-item-stock,
.order-item-stock-cost,
.order-item-profit {
  display: block;
  min-height: 32px;
  line-height: 32px;
  color: #20333d;
  font-weight: 600;
  text-align: right;
  padding-right: 6px;
}

.order-item-profit.negative {
  color: #b42323;
}

.order-item-profit.positive {
  color: #16733b;
}

.item-table-sort-button {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.item-table-sort-button:hover {
  color: #126782;
  text-decoration: underline;
}

.order-item-row.stock-insufficient td {
  background: #ffdede;
}

.order-item-row.stock-insufficient input,
.order-item-row.stock-insufficient select {
  border-color: #d95858;
}

.order-item-row.missing-product td {
  background: #fff8df;
}

.order-item-row.missing-product input[name="itemBarcode"] {
  border-color: #c58920;
  font-weight: 700;
}

.icon-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

.drag-cell {
  padding: 5px 4px;
}

.drag-handle {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  background: #e8eef2;
  color: #52606a;
  cursor: grab;
  font-size: 15px;
  line-height: 1;
}

.drag-handle:hover {
  background: #d7e3e9;
  color: #176b87;
}

.order-item-row.dragging {
  opacity: 0.55;
  outline: 2px dashed #176b87;
  outline-offset: -2px;
}

.item-table-wrap {
  overflow-x: hidden;
  overflow-y: visible;
}

.item-table th,
.item-table td {
  white-space: normal;
}

.item-table input {
  min-height: 32px;
  padding: 5px 7px;
}

.product-name-with-reference {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 58px;
  gap: 6px 8px;
  align-items: center;
}

.product-name-with-reference input {
  grid-column: 1;
}

.product-reference {
  grid-column: 1 / -1;
}

.order-product-image {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: center;
}

.order-product-thumb,
.product-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  border: 1px solid #d6e0e6;
  border-radius: 6px;
  background: #fff;
}

.order-product-thumb {
  width: 54px;
  height: 54px;
}

.product-thumb {
  width: 44px;
  height: 44px;
}

.product-thumb-empty {
  color: #91a0aa;
  font-size: 12px;
}

.product-name-with-reference {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(180px, max-content);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.product-name-with-reference input {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-reference {
  color: #a1adb5;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-name-with-reference {
  display: grid;
  grid-template-columns: 280px 40px 170px;
  justify-content: start;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.product-name-with-reference input {
  grid-column: 1;
  min-width: 0;
  width: 100%;
}

.order-product-image {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-reference {
  grid-column: 3;
  grid-row: 1;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-product-thumb {
  width: 36px;
  height: 36px;
  cursor: zoom-in;
}

.product-thumb,
#productImagePreview {
  cursor: zoom-in;
}

.image-hover-preview {
  position: fixed;
  z-index: 9999;
  pointer-events: auto;
  width: 280px;
  max-width: min(320px, 40vw);
  padding: 8px;
  border: 1px solid #cfd9df;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(20, 34, 45, 0.25);
}

.image-hover-preview.modal {
  left: 50% !important;
  top: 50% !important;
  width: min(980px, calc(100vw - 80px));
  max-width: calc(100vw - 80px);
  min-height: min(720px, calc(100vh - 80px));
  padding: 70px 110px;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 70px rgba(20, 34, 45, 0.35);
}

.image-hover-preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.image-hover-preview.modal img {
  width: min(680px, 100%);
  height: min(500px, calc(100vh - 260px));
  max-height: none;
  margin: 0 auto;
}

.image-hover-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(20, 34, 45, 0.72);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.image-hover-preview.modal .image-hover-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.image-hover-nav {
  position: absolute;
  top: 50%;
  width: 32px;
  min-width: 32px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  transform: translateY(-50%);
  border-radius: 8px;
  background: rgba(23, 107, 135, 0.88);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.image-hover-preview:not(.modal) .image-hover-nav {
  display: none;
}

.image-hover-preview.modal .image-hover-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.image-hover-nav.prev {
  left: 8px;
}

.image-hover-preview.modal .image-hover-nav.prev {
  left: 20px;
}

.image-hover-nav.next {
  right: 8px;
}

.image-hover-preview.modal .image-hover-nav.next {
  right: 20px;
}

.image-hover-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20, 34, 45, 0.72);
  color: #fff;
  font-size: 12px;
}

.product-image-file-field input[type="file"] {
  padding: 7px;
  background: #fff;
}

.price-with-rate {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 62px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.price-with-rate input {
  min-width: 0;
  width: 100%;
}

.secondary {
  background: #687782;
}

.master-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

#mastersView,
#permissionsView,
#usersView {
  --management-width: min(980px, 100%);
}

#mastersView.product-mode {
  --management-width: min(100%, calc(100vw - 250px));
}

#mastersView.product-mode .master-search-panel {
  width: min(1120px, var(--management-width));
  grid-template-columns: 160px minmax(380px, 1fr) 76px 88px;
}

.master-search-panel {
  display: grid;
  grid-template-columns: 160px minmax(260px, 1fr) 76px 88px;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  background: white;
  border: 1px solid #cfd7de;
  border-left: 4px solid #176b87;
  border-radius: 8px;
  width: var(--management-width);
}

.master-search-panel datalist {
  display: none;
}

.master-search-panel label {
  gap: 5px;
  font-size: 12px;
  color: #56636d;
}

.master-search-panel input,
.master-search-panel select,
.master-search-panel button {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
}

.fixed-field {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  min-width: 130px;
  padding: 5px 8px;
  border: 1px solid #c9d7df;
  border-radius: 6px;
  background: #eef4f7;
  color: #1f2b33;
  font-size: 13px;
}

.master-tab {
  background: #687782;
}

.master-tab.active {
  background: #176b87;
}

.master-form {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  border: 1px solid #d8dee3;
  border-radius: 8px;
  padding: 14px;
  width: var(--management-width);
  box-shadow: 0 6px 16px rgba(20, 34, 45, 0.04);
}

#customerMasterForm {
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.3fr) auto;
}

#staffMasterForm {
  grid-template-columns: minmax(240px, 1fr) 150px 150px auto;
}

.master-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.master-field span {
  color: #52616b;
  font-size: 12px;
  font-weight: 700;
}

.master-field input,
.master-field select {
  min-height: 36px;
  padding: 7px 10px;
  background: #ffffff;
}

.master-field input:focus,
.master-field select:focus {
  border-color: #176b87;
  outline: 2px solid rgba(23, 107, 135, 0.12);
}

.master-field-wide {
  min-width: 0;
}

.master-form-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: flex-end;
  white-space: nowrap;
}

.master-form-actions button {
  min-width: 92px;
}

.product-form {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  width: min(1500px, 100%);
}

.product-form-section {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(20, 34, 45, 0.05);
}

.product-form-section h3 {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #dfe7ed;
  background: linear-gradient(90deg, #eaf3f7, #f7fafc);
  color: #20313b;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.product-form-section h3::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: #176b87;
}

.product-basic-section h3::before {
  background: #176b87;
}

.product-name-section h3::before {
  background: #6b7f2a;
}

.product-price-section h3::before {
  background: #a9652a;
}

.product-package-section h3::before {
  background: #596d7a;
}

.product-form-section .master-field,
.product-form-section .dimension-field {
  box-sizing: border-box;
  min-height: 76px;
  padding: 8px;
  border-right: 1px solid #e1e7ec;
  border-bottom: 1px solid #e1e7ec;
}

.product-form-section .master-field span,
.product-form-section .dimension-field > span,
.product-form-section .dimension-field legend {
  min-height: 18px;
  margin: 0 0 4px;
  line-height: 18px;
}

.product-basic-section,
.product-name-section,
.product-package-section {
  grid-column: 1 / -1;
}

.product-basic-section {
  border-color: #c8dce5;
}

.product-name-section {
  border-color: #d6dfbd;
}

.product-price-section {
  border-color: #e5d0bc;
}

.product-package-section {
  border-color: #d3dde3;
}

.product-basic-section h3 {
  background: linear-gradient(90deg, #e8f3f7, #f8fbfc);
}

.product-name-section h3 {
  background: linear-gradient(90deg, #f0f5df, #fbfcf6);
}

.product-price-section h3 {
  background: linear-gradient(90deg, #f7eee5, #fffaf6);
}

.product-package-section h3 {
  background: linear-gradient(90deg, #edf2f5, #fbfcfd);
}

.product-price-section {
  grid-column: 1 / span 8;
}

.product-image-section {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 260px;
  border-color: #d8e3ea;
}

.product-image-section h3 {
  background: linear-gradient(90deg, #eef6f8, #fbfdfe);
}

.product-image-section h3::before {
  background: #3d7b8a;
}

.product-barcode-field {
  grid-column: span 3;
}

.product-name-field {
  grid-column: span 6;
}

.product-chinese-name-field {
  grid-column: span 6;
}

.product-alias-field {
  grid-column: 1 / -1;
}

.product-image-gallery {
  grid-column: 1;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  min-height: 132px;
  padding: 8px;
  border-right: 1px solid #e1e7ec;
  border-bottom: 0;
  background: #f8fbfc;
  overflow-x: auto;
}

.product-main-image-panel,
.product-all-images-panel {
  min-width: 0;
}

.product-image-panel-title {
  margin-bottom: 6px;
  color: #52616b;
  font-size: 12px;
  font-weight: 800;
}

.product-main-image-card {
  width: 132px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #176b87;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.08);
}

.product-main-image-card img {
  max-width: 118px;
  max-height: 96px;
  object-fit: contain;
}

.product-all-images-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 4px;
}

.product-image-card {
  flex: 0 0 auto;
  width: 112px;
  padding: 6px;
  border: 1px solid #d5e0e7;
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.product-image-card.main {
  border-color: #176b87;
  box-shadow: 0 0 0 2px rgba(23, 107, 135, 0.12);
}

.product-image-card.dragging {
  cursor: grabbing;
  opacity: 0.55;
  transform: scale(0.98);
}

.product-image-card.drag-over {
  border-color: #bf7f3a;
  box-shadow: 0 0 0 3px rgba(191, 127, 58, 0.18);
}

.product-image-card img {
  display: block;
  width: 98px;
  height: 78px;
  object-fit: contain;
  border: 1px solid #d5e0e7;
  border-radius: 6px;
  background: #fff;
}

.product-image-card-main-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(23, 107, 135, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.product-image-card-actions {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  padding: 5px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(to top, rgba(10, 25, 34, 0.78), rgba(10, 25, 34, 0.42));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.product-image-card:hover .product-image-card-actions,
.product-image-card:focus-within .product-image-card-actions {
  opacity: 1;
  pointer-events: auto;
}

.product-image-card-actions button {
  min-width: 0;
  min-height: 26px;
  padding: 0 7px;
  font-size: 11px;
  border-radius: 5px;
}

.product-image-empty {
  color: #91a0aa;
  font-size: 12px;
}

.product-image-file-field {
  grid-column: 2;
  min-height: 132px;
  align-content: center;
  border-bottom: 0;
  border-right: 0;
}

.product-image-file-field span {
  white-space: nowrap;
}

.product-image-file-field input[type="file"] {
  min-width: 220px;
  width: fit-content;
  max-width: 100%;
}

.product-spec-field,
.product-model-field,
.product-customs-field {
  grid-column: span 2;
}

.product-supplier-field {
  grid-column: span 3;
}

.price-field {
  grid-column: span 3;
}

.price-field input {
  text-align: right;
}

.product-package-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns:
    minmax(170px, 220px)
    minmax(170px, 220px)
    minmax(170px, 220px)
    minmax(420px, 1fr);
  gap: 0;
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid #dfe7ed;
  background: #fbfcfd;
}

.product-package-group:last-child {
  border-bottom: 0;
}

.product-package-group h4 {
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 10px 5px;
  color: #42515c;
  font-size: 13px;
  font-weight: 800;
  background: rgba(237, 242, 245, 0.65);
}

.product-package-group .master-field,
.product-package-group .dimension-field {
  display: grid;
  grid-template-rows: 18px 36px;
  row-gap: 5px;
  align-content: start;
  min-height: 72px;
  padding: 8px;
}

.product-package-group .master-field span,
.product-package-group .dimension-field > span,
.product-package-group .dimension-field legend {
  display: block;
  grid-row: 1;
  align-self: start;
  min-height: 18px;
  margin: 0;
  padding: 0;
  line-height: 18px;
}

.product-package-group .master-field input,
.product-package-group .dimension-inputs {
  grid-row: 2;
  align-self: start;
  height: 36px;
  min-height: 36px;
}

.product-box-number-field,
.product-case-quantity-field,
.product-case-weight-field,
.product-unit-weight-field {
  grid-column: auto;
}

.product-box-number-field {
  grid-column: 1;
}

.product-case-quantity-field {
  grid-column: 2;
}

.product-case-weight-field {
  grid-column: 3;
}

.product-unit-weight-field {
  grid-column: 1;
}

.product-case-size-field {
  grid-column: 4;
}

.product-unit-size-field {
  grid-column: 2 / -1;
}

.dimension-field {
  grid-column: span 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 18px 36px;
  row-gap: 5px;
  min-width: 0;
  margin: 0;
  border: 0;
  min-inline-size: 0;
}

.dimension-field > span,
.dimension-field legend {
  grid-column: 1 / -1;
  grid-row: 1;
  padding: 0;
  color: #52616b;
  font-size: 12px;
  font-weight: 700;
}

.dimension-inputs {
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.dimension-field input {
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 7px 8px;
  text-align: right;
}

.product-package-group .dimension-inputs input {
  grid-row: auto;
}

.dimension-field.product-case-size-field {
  grid-column: 4;
}

.dimension-field.product-unit-size-field {
  grid-column: 2 / -1;
}

.product-form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding-top: 2px;
}

.user-form {
  grid-template-columns: 150px 160px 95px 82px 170px 150px 118px;
  align-items: end;
}

.user-form-field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #52616b;
}

.user-form-field input,
.user-form-field select {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #cad5dd;
  border-radius: 4px;
  font-size: 13px;
}

.user-form-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-start;
  min-width: 118px;
}

#usersView .master-search-panel button,
#usersView .user-form button {
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 5px 10px;
  white-space: nowrap;
}

.user-form input[disabled] {
  background: #eef2f5;
  color: #52606b;
  cursor: not-allowed;
}

.master-list {
  background: white;
  border: 1px solid #d8dee3;
  border-radius: 8px;
  max-height: 62vh;
  overflow: auto;
  width: var(--management-width);
}

.master-list.empty {
  display: none !important;
}

#productMasterList:empty,
#productMasterList.empty,
#productsMaster:has(#productMasterForm:not(.hidden)) #productMasterList {
  display: none !important;
}

#mastersView.product-mode .master-list {
  max-height: calc(100vh - 145px);
  min-height: 600px;
  overflow-x: hidden;
}

.master-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr)) 104px;
  gap: 0;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e4e8ec;
  font-size: 13px;
}

.master-row > span {
  min-height: 24px;
  padding: 0 8px;
  border-right: 1px solid #e3e9ee;
  overflow: hidden;
  text-overflow: ellipsis;
}

#newOrderView:not(.copy-order-modal-mode) {
  width: 100%;
}

#newOrderView:not(.copy-order-modal-mode) #orderForm {
  width: min(1940px, 100%);
  max-width: 1940px;
}

#newOrderView:not(.copy-order-modal-mode) #orderForm .item-table-wrap {
  padding-right: 10px;
  padding-left: 10px;
}

.master-row > span:first-child {
  padding-left: 0;
}

.master-row > span:last-child,
.master-row > .master-actions {
  border-right: 0;
}


.master-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef3f6;
  color: #45535d;
  font-weight: 700;
  cursor: default;
  box-shadow: 0 2px 0 #91a7b4;
}

.customer-master-row {
  grid-template-columns: minmax(220px, 0.9fr) minmax(220px, 1fr) 104px;
}

.staff-master-row {
  grid-template-columns: minmax(240px, 1fr) 150px 150px 104px;
}

.product-master-row {
  grid-template-columns: var(--product-master-columns, minmax(0, 1fr) 65px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 0.8fr) repeat(3, minmax(0, 0.7fr)) 70px 80px 95px 80px 95px 104px);
  min-width: 0;
}

.product-master-row.master-header > span {
  position: relative;
  padding-right: 14px;
}

.master-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 2;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

.master-resize-handle::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

.master-resize-handle:hover::after {
  background: #91a7b4;
}

.product-master-row > span:nth-child(12),
.product-master-row > span:nth-child(14) {
  white-space: pre-line;
  line-height: 1.35;
  min-height: 52px;
}

.product-master-row.master-header > span:nth-child(10),
.product-master-row.master-header > span:nth-child(11),
.product-master-row.master-header > span:nth-child(12),
.product-master-row.master-header > span:nth-child(13),
.product-master-row.master-header > span:nth-child(14) {
  min-height: 24px;
  white-space: pre-line;
  line-height: 1.25;
}

.user-master-row,
.user-row {
  grid-template-columns: minmax(135px, 1fr) minmax(145px, 1fr) 88px 76px minmax(120px, 0.9fr) minmax(140px, 1fr) minmax(155px, 1fr) minmax(130px, 0.95fr) minmax(130px, 0.95fr) 78px;
  column-gap: 10px;
  width: 100%;
  min-width: 0;
}

#usersView .master-form,
#userList {
  width: min(1500px, calc(100vw - 270px));
}

#usersView .master-search-panel {
  width: min(720px, calc(100vw - 270px));
  grid-template-columns: 160px 160px 76px 96px;
}

#userList {
  overflow-x: hidden;
}

.user-row input,
.user-row select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
  font-size: 13px;
}

.user-row .master-actions {
  display: flex;
  gap: 5px;
  justify-content: center;
  white-space: nowrap;
}

.account-form {
  max-width: 720px;
}

.account-order-preferences {
  margin-top: 6px;
  padding: 14px;
  border: 1px solid #c9d9e1;
  border-radius: 8px;
  background: #f8fbfc;
}

.account-order-preferences-head h3 {
  margin: 0;
  color: #203844;
  font-size: 16px;
}

.account-order-preferences-head p {
  margin: 5px 0 12px;
  color: #687b85;
  font-size: 12px;
}

.account-order-preference-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-order-preference-groups fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 11px;
  border: 1px solid #d5e0e5;
  border-radius: 7px;
  background: #fff;
}

.account-order-preference-groups legend {
  padding: 0 5px;
  color: #176b87;
  font-weight: 700;
}

.account-order-preference-groups label {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

@media (max-width: 760px) {
  .account-order-preference-groups {
    grid-template-columns: 1fr;
  }
}

.permission-matrix {
  width: fit-content;
  max-width: 100%;
  margin: 12px 0;
}

.permission-title {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  font-weight: 700;
  color: #1f2b33;
  margin: 0 0 8px;
  max-width: none;
}

.permission-title button {
  min-height: 30px;
  padding: 4px 14px;
  font-size: 13px;
}

.permission-table-wrap {
  width: fit-content;
  max-width: none;
  overflow-x: visible;
  overflow-y: visible;
  border: 1px solid #d7e0e6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 34, 45, 0.04);
}

.permission-table {
  width: max-content;
  min-width: max-content;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.permission-table th,
.permission-table td {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  height: 54px;
  padding: 8px 8px;
  font-size: 12px;
  line-height: 1.25;
  border: 0;
  border-right: 1px solid #edf2f5;
  border-bottom: 1px solid #e6edf1;
}

.permission-table th:last-child,
.permission-table td:last-child {
  border-right: 0;
}

.permission-table thead th {
  background: #eef5f8;
  color: #25343d;
  font-weight: 700;
  border-bottom: 2px solid #b6c6d0;
  height: 48px;
  border-right-color: #d7e3ea;
  box-shadow: inset -1px 0 0 rgba(143, 166, 178, 0.2);
}

.permission-table thead th:nth-child(even) {
  background: #f7faf2;
}

.permission-table thead th:nth-child(odd):not(:first-child) {
  background: #eef6fb;
}

.permission-table tbody th {
  background: #f7fafb;
  color: #1f2b33;
  font-weight: 700;
  height: 54px;
}

.permission-table tbody tr:last-child th,
.permission-table tbody tr:last-child td {
  border-bottom: 0;
}

.permission-table tbody tr:hover th,
.permission-table tbody tr:hover td {
  background: #f7fbfd;
}

.permission-table tbody td {
  cursor: pointer;
}

.permission-table th:first-child {
  text-align: left;
  min-width: 118px;
  width: 118px;
}

.permission-table th:not(:first-child),
.permission-table td:not(:first-child) {
  min-width: max-content;
  width: max-content;
}

.permission-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.permission-column-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row-reverse;
  gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  min-width: max-content;
  padding: 0 6px;
}

.permission-column-toggle span {
  display: inline-block;
}

.report-filter-panel {
  display: grid;
  grid-template-columns: repeat(6, max-content);
  gap: 10px;
  align-items: end;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 12px;
  background: white;
  border: 1px solid #cfd7de;
  border-left: 4px solid #176b87;
  border-radius: 8px;
}

.report-filter-panel label {
  min-width: 138px;
}

.report-filter-panel .report-keyword {
  min-width: 220px;
}

.report-filter-panel label {
  gap: 5px;
  font-size: 12px;
  color: #56636d;
}

.report-filter-panel input,
.report-filter-panel select,
.report-filter-panel button {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
}

.report-summary {
  display: grid;
  gap: 12px;
  max-width: none;
  margin-bottom: 18px;
}

.report-primary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
}

.report-category-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
}

.report-card {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 14px 16px;
  background: #176b87;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(20, 34, 45, 0.12);
}

.report-card b {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 700;
}

.report-card strong {
  color: #ffffff;
  font-size: 24px;
  line-height: 1.1;
}

.report-card span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 600;
}

.report-card.teal { background: #176b87; }
.report-card.blue { background: #2f5f8f; }
.report-card.orange { background: #c87918; }
.report-card.purple { background: #6b4a99; }
.report-card.green { background: #24734a; }
.report-card.red { background: #b23b34; }

.report-card-primary {
  position: relative;
  align-content: center;
  min-height: 132px;
  padding: 20px 24px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(20, 34, 45, 0.16);
}

.report-card-primary::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -72px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.report-card-primary.sales {
  background: linear-gradient(135deg, #174f7a, #2f6da3);
}

.report-card-primary.profit {
  background: linear-gradient(135deg, #17613d, #2a8257);
}

.report-card-primary.margin {
  background: linear-gradient(135deg, #865b12, #b57a18);
}

.report-card-primary.loss {
  background: linear-gradient(135deg, #8f2f2a, #bd4a42);
}

.report-card-primary b {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.report-card-primary strong {
  position: relative;
  z-index: 1;
  margin: 3px 0;
  font-size: clamp(30px, 2.4vw, 42px);
  font-variant-numeric: tabular-nums;
}

.report-card-primary span {
  font-size: 13px;
}

.report-category-card {
  --category-color: #607d8b;
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 15px 16px 13px;
  background: #ffffff;
  border: 1px solid #dbe3e8;
  border-top: 4px solid var(--category-color);
  border-radius: 9px;
  color: #263944;
  box-shadow: 0 5px 14px rgba(20, 34, 45, 0.07);
}

.report-category-card.domestic { --category-color: #d68a25; }
.report-category-card.r1-domestic { --category-color: #8060aa; }
.report-category-card.r1-export { --category-color: #3d8a60; }
.report-category-card.combined { --category-color: #4b9095; }

.report-category-head,
.report-category-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-category-head b {
  color: #263944;
  font-size: 15px;
}

.report-category-head span {
  color: var(--category-color);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.report-category-sales {
  display: grid;
  gap: 2px;
}

.report-category-sales small,
.report-category-details small,
.report-aux-metrics small {
  color: #88959d;
  font-size: 10px;
}

.report-category-sales strong {
  color: #20343f;
  font-size: clamp(22px, 1.55vw, 28px);
  font-variant-numeric: tabular-nums;
}

.report-category-details > span {
  display: grid;
  gap: 2px;
}

.report-category-details > span:last-child { text-align: right; }

.report-category-details b {
  color: #26704a;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.report-category-details b.negative { color: #b23b34; }

.report-share-track {
  height: 5px;
  overflow: hidden;
  background: #edf1f3;
  border-radius: 999px;
}

.report-share-track i {
  display: block;
  height: 100%;
  background: var(--category-color);
  border-radius: inherit;
}

.report-aux-metrics {
  display: flex;
  gap: 24px;
  padding: 8px 13px;
  background: #f8fafb;
  border: 1px solid #e0e6ea;
  border-radius: 7px;
}

.report-aux-metrics > span {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 8px;
}

.report-aux-metrics b {
  color: #667681;
  font-size: 11px;
}

.report-aux-metrics strong {
  color: #263944;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.report-aux-metrics small { grid-column: 1 / -1; }

@media (max-width: 1400px) {
  .report-category-metrics {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 820px) {
  .report-primary-metrics {
    grid-template-columns: 1fr;
  }

  .report-category-metrics {
    grid-template-columns: 1fr;
  }

  .report-aux-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

.report-section {
  margin-bottom: 16px;
  padding: 14px;
  background: white;
  border: 1px solid #d8dee3;
  border-radius: 8px;
}

.report-view.report-query-flash .report-section,
.report-view.report-query-flash .report-summary,
.report-view.report-query-flash .graphic-dashboard {
  animation: report-query-flash 0.85s ease;
}

@keyframes report-query-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(23, 107, 135, 0);
  }
  25% {
    box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.22);
    background-color: #f2fbfd;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(23, 107, 135, 0);
  }
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.trend-filter-panel {
  grid-template-columns: repeat(7, max-content);
  width: fit-content;
  margin: 0 0 12px;
  padding: 10px;
  box-shadow: none;
}

.trend-filter-panel label {
  min-width: 96px;
}

.trend-filter-panel .report-keyword {
  min-width: 220px;
}

.trend-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.trend-tab {
  min-height: 34px;
  padding: 0 16px;
  background: #687782;
}

.trend-tab.active {
  background: #176b87;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  font-size: 12px;
  color: #4e5d66;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 260px;
}

.trend-legend i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  background: var(--marker-color);
}

.trend-legend i.circle {
  border-radius: 50%;
}

.trend-legend i.triangle {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 13px solid var(--marker-color);
}

.trend-legend i.square {
  border-radius: 2px;
}

.trend-legend i.diamond {
  transform: rotate(45deg);
  border-radius: 2px;
}

.trend-plot {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px 6px;
  border: 1px solid #e0e7ec;
  border-radius: 8px;
  background: #fff;
}

.trend-y-axis {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  height: 252px;
  padding: 3px 0 34px;
  color: #52616b;
  font-size: 11px;
  text-align: right;
}

.trend-plot-area {
  position: relative;
  height: 252px;
  min-width: 0;
}

.trend-plot-area .dashboard-line {
  width: 100%;
  height: 100%;
  display: block;
}

.trend-axis-line {
  stroke: #31444e;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.trend-grid-line {
  stroke: #d9e1e6;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.trend-marker {
  position: absolute;
  z-index: 2;
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
  background: var(--marker-color);
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.25);
}

.trend-marker.circle {
  border-radius: 50%;
}

.trend-marker.triangle {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 15px solid var(--marker-color);
  box-shadow: none;
}

.trend-marker.square {
  border-radius: 3px;
}

.trend-marker.diamond {
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 3px;
}

.trend-x-axis {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 4px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  color: #52616b;
  font-size: 12px;
  text-align: center;
}

.compare-filter-panel {
  grid-template-columns: repeat(6, max-content);
  width: fit-content;
  margin-bottom: 10px;
  box-shadow: none;
  padding: 10px;
}

.compare-filter-panel label {
  min-width: 104px;
}

.compare-filter-panel select {
  min-width: 96px;
}

.compare-chart {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.compare-block {
  min-width: 0;
}

.compare-subtitle {
  margin: 8px 0 2px;
  color: #20313b;
  font-size: 14px;
}

.compare-column-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 220px;
  padding: 10px 10px 6px;
  border: 1px solid #e2e9ee;
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(148, 163, 184, 0.2) 1px, transparent 1px) 0 0 / 100% 25%,
    #ffffff;
}

.compare-column-chart.compact {
  min-height: 220px;
}

.compare-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  min-width: 0;
  height: 100%;
}

.compare-column-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  min-height: 145px;
}

.compare-column-chart.compact .compare-column-bars {
  min-height: 145px;
}

.compare-column-bar {
  width: 15px;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
}

.compare-column-bar.current {
  background: #176b87;
}

.compare-column-bar.previous {
  background: #f0a23a;
}

.compare-column-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 12px;
  color: #4f5e68;
}

.compare-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: -4px;
  font-size: 12px;
  color: #52606b;
}

#reportTrendsView .report-table table {
  min-width: 0;
  width: 100%;
}

.compare-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.compare-legend i {
  width: 14px;
  height: 10px;
  border-radius: 3px;
}

.compare-legend .current {
  background: #176b87;
}

.compare-legend .previous {
  background: #f0a23a;
}

.rank-change {
  font-weight: 700;
}

.rank-change.up {
  color: #c53030;
}

.rank-change.down {
  color: #1f7a4d;
}

.rank-change.neutral {
  color: #111827;
}

.report-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.report-title h2 {
  margin: 0;
  font-size: 16px;
  color: #20313b;
}

.report-chart {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 120px 1fr 110px;
  gap: 10px;
  align-items: center;
  min-height: 28px;
  font-size: 13px;
}

.chart-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-track {
  height: 10px;
  overflow: hidden;
  background: #edf1f4;
  border-radius: 999px;
}

.chart-bar {
  height: 100%;
  min-width: 2px;
  background: #176b87;
  border-radius: inherit;
}

.chart-bar.profit {
  background: #2c8b57;
}

.chart-value {
  text-align: right;
  color: #52606a;
}

.report-table {
  overflow: auto;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
}

.report-table table {
  min-width: 720px;
}

.report-table th,
.report-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.staff-performance-table .staff-name-merged,
.staff-performance-table .staff-rank-merged {
  font-weight: 800;
  border-right-color: #aebfc9;
}

.staff-performance-table .staff-rank-merged {
  text-align: center;
  font-size: 16px;
}

.staff-performance-table tbody tr.staff-person-tone-1 > td { background: #f2f8fc; }
.staff-performance-table tbody tr.staff-person-tone-2 > td { background: #f8f5fc; }
.staff-performance-table tbody tr.staff-person-tone-3 > td { background: #f2faf5; }
.staff-performance-table tbody tr.staff-person-tone-4 > td { background: #fff8ed; }

.staff-performance-table tbody tr.staff-person-start > td {
  border-top: 2px solid #b7c7d0;
}

.staff-performance-type {
  display: inline-block;
  min-width: 44px;
  padding: 3px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.staff-performance-type.domestic {
  color: #176236;
  background: #e7f5ec;
}

.staff-performance-type.export {
  color: #176b87;
  background: #e5f2f7;
}

.staff-commission-cell {
  font-weight: 800;
  color: #7a4d0f;
}

.staff-commission-cell small {
  margin-left: 4px;
  color: #7b8790;
  font-size: 11px;
  font-weight: 600;
}

#reportLongStockView {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#reportLongStockView .report-section {
  height: 100%;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#longStockSummary .long-stock-summary-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 66px;
  padding: 9px 14px;
  border: 1px solid #efc48b;
  border-left: 5px solid #e58a19;
  border-radius: 6px;
  background: #fff7e9;
}

#longStockSummary .long-stock-summary-main span {
  font-size: 16px;
  font-weight: 800;
  color: #553817;
}

#longStockSummary .long-stock-summary-main strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: 32px;
  line-height: 1;
  color: #b65d00;
  text-align: right;
  white-space: nowrap;
}

#longStockSummary .long-stock-summary-main b {
  margin-top: 4px;
  color: #846b50;
  font-size: 13px;
}

#longStockSummary .long-stock-claim-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

#longStockSummary .long-stock-claim-counts span:first-child {
  color: #237347;
}

#longStockSummary .long-stock-claim-counts span:last-child {
  color: #a54d2a;
}

#longStockSummary .long-stock-summary-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 16px;
  padding: 8px 12px;
  border: 1px solid #dde5ea;
  border-radius: 6px;
  background: #f7f9fa;
  color: #687780;
  font-size: 12px;
}

#longStockSummary .long-stock-summary-meta .is-error {
  color: #a33b3b;
}

#longStockSummary .long-stock-summary-meta small {
  flex-basis: 100%;
  color: #89959c;
}

#longStockTable .long-stock-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

#longStockTable .long-stock-code-col {
  width: 118px;
}

#longStockTable .long-stock-warehouse-col {
  width: 82px;
}

#longStockTable .long-stock-name-col {
  width: 24%;
}

#longStockTable .long-stock-qty-col {
  width: 88px;
}

#longStockTable .long-stock-management-fee-col {
  width: 190px;
}

#longStockTable .long-stock-management-fee-cell span {
  color: #66757f;
  font-size: 12px;
  white-space: nowrap;
}

#longStockTable .long-stock-date-col {
  width: 128px;
}

#longStockTable .long-stock-age-col {
  width: 92px;
}

#longStockTable .long-stock-staff-col {
  width: 120px;
}

#longStockTable .long-stock-note-col {
  width: 220px;
}

#longStockTable .long-stock-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef5f8;
  box-shadow: inset 0 -2px 0 #8fa8b7;
}

#longStockTable .long-stock-table th,
#longStockTable .long-stock-table td {
  border-right: 1px solid #e2eaf0;
  border-bottom: 1px solid #e2eaf0;
  padding: 8px 8px;
  white-space: normal;
  word-break: break-word;
}

#longStockTable .long-stock-table th:last-child,
#longStockTable .long-stock-table td:last-child {
  border-right: 0;
}

#longStockTable .long-stock-assigned-row td {
  background: #e7f7ec;
  border-bottom-color: #b9dfc5;
}

#longStockTable .long-stock-assigned-row .long-stock-staff-select,
#longStockTable .long-stock-assigned-row .long-stock-note-input {
  border-color: #91c8a2;
  background: #f7fff9;
}

.long-stock-staff-select {
  width: 100%;
  height: 32px;
  border: 1px solid #cbd7df;
  border-radius: 4px;
  background: #fff;
}

.long-stock-note-input {
  width: 100%;
  min-height: 34px;
  max-height: 74px;
  padding: 5px 7px;
  border: 1px solid #cbd7df;
  border-radius: 4px;
  background: #fff;
  resize: vertical;
  font: inherit;
  line-height: 1.35;
}

.stock-age-cell strong {
  display: block;
  color: #0f4f63;
}

.stock-age-cell span {
  display: block;
  margin-top: 2px;
  color: #71808b;
  font-size: 12px;
}

.risk-inventory-tabs {
  display: flex;
  gap: 6px;
  margin: 8px 0;
  border-bottom: 1px solid #cbd8e0;
}

.risk-inventory-tabs button {
  min-width: 150px;
  padding: 8px 16px;
  border: 1px solid #cbd8e0;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #edf3f6;
  color: #52646f;
}

.risk-inventory-tabs button.active {
  background: #17738b;
  border-color: #17738b;
  color: #fff;
}

.risk-inventory-tabs b {
  display: inline-block;
  min-width: 24px;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: #315966;
}

.risk-inventory-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 8px;
}

.risk-inventory-filters label:nth-child(1),
.risk-inventory-filters label:nth-child(2) {
  width: 230px;
}

.risk-inventory-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 8px 0;
  padding: 8px 12px;
  border: 1px solid #e2a6a0;
  border-left: 5px solid #c44336;
  border-radius: 5px;
  background: #fff0ee;
  color: #93352d;
}

.risk-inventory-warning strong {
  flex-basis: 100%;
}

.risk-inventory-task-status {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 32px;
  margin-left: auto;
  padding: 0 4px 2px;
  color: #687780;
  font-size: 12px;
  white-space: nowrap;
}

.risk-inventory-task-status .is-error {
  color: #a33b3b;
}

.report-title h2 .risk-inventory-title-count {
  margin-left: 5px;
  color: #126984;
  font-size: inherit;
  font-weight: 800;
}

#longStockTable .risk-inventory-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

#longStockTable {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#longStockTable .risk-inventory-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef5f8;
  box-shadow: inset 0 -2px 0 #8fa8b7;
}

#longStockTable .risk-inventory-table th,
#longStockTable .risk-inventory-table td {
  padding: 8px;
  border-right: 1px solid #e2eaf0;
  border-bottom: 1px solid #e2eaf0;
  vertical-align: top;
}

#longStockTable .risk-inventory-table th:nth-child(1) { width: 130px; }
#longStockTable .risk-inventory-table th:nth-child(2) { width: 260px; }
#longStockTable .risk-inventory-table th:nth-child(3) { width: 90px; }
#longStockTable .risk-inventory-table th:nth-child(4) { width: 90px; }
#longStockTable .risk-inventory-table th:nth-child(5) { width: 120px; }
#longStockTable .risk-inventory-table th:nth-child(6) { width: 410px; }
#longStockTable .risk-inventory-table th:nth-child(7) { width: 140px; }

.risk-inventory-change summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.risk-inventory-change summary::-webkit-details-marker {
  display: none;
}

.risk-inventory-change summary span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-inventory-change summary b {
  color: #20758b;
  transition: transform 0.15s ease;
}

.risk-inventory-change[open] summary b {
  transform: rotate(180deg);
}

.risk-inventory-change-detail {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed #cbd8e0;
}

.risk-inventory-last-times {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 6px;
  color: #667780;
  font-size: 12px;
}

.risk-inventory-change-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.risk-inventory-change-detail th,
.risk-inventory-change-detail td {
  padding: 4px !important;
  border: 1px solid #dbe4e9 !important;
  text-align: right;
  white-space: nowrap;
}

.risk-inventory-change-detail th:first-child,
.risk-inventory-change-detail td:first-child {
  text-align: left;
}

.loss-row td {
  background: #fff3f0;
}

.ranking-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.ranking-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(140px, 240px) minmax(140px, 1fr) minmax(96px, 120px);
  gap: 12px;
  align-items: center;
  min-height: 30px;
  font-size: 14px;
  min-width: 0;
}

.ranking-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #e9eff3;
  color: #53616b;
  font-weight: 700;
}

.ranking-row.top .ranking-rank {
  background: #176b87;
  color: white;
}

.ranking-rank.medal.gold {
  background: linear-gradient(135deg, #f7c948, #d99904);
  color: #342400;
}

.ranking-rank.medal.silver {
  background: linear-gradient(135deg, #e5e9ef, #9aa6b2);
  color: #26313a;
}

.ranking-rank.medal.bronze {
  background: linear-gradient(135deg, #d69a62, #9c5a2e);
  color: white;
}

.ranking-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #20313b;
}

.ranking-track {
  height: 10px;
  overflow: hidden;
  background: #e9eef2;
  border-radius: 999px;
  min-width: 0;
}

.ranking-bar {
  display: block;
  height: 100%;
  min-width: 3px;
  background: #8aa0ac;
  border-radius: inherit;
}

.ranking-row.top .ranking-bar {
  background: linear-gradient(90deg, #176b87, #35a3c7);
}

.ranking-value {
  text-align: right;
  color: #2c3b44;
  font-variant-numeric: tabular-nums;
}

.floating-tooltip {
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  max-width: 420px;
  padding: 10px 12px;
  background: rgba(32, 49, 59, 0.96);
  color: white;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(20, 34, 45, 0.24);
  pointer-events: none;
}

.floating-tooltip b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

.stock-tip-table {
  display: grid;
  gap: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.stock-tip-title {
  margin-top: 3px;
  color: #ffd166;
  font-weight: 700;
}

.stock-tip-title:first-child {
  margin-top: 0;
}

.stock-tip-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(100px, 1fr) 56px;
  gap: 10px;
  align-items: center;
}

.stock-tip-row span,
.stock-tip-row b {
  display: block;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

.stock-tip-row b {
  font-weight: 700;
}

.row-flash td {
  animation: rowFlash 1.3s ease-out;
}

@keyframes rowFlash {
  0%, 35% { background: #fff0a8; }
  100% { background: inherit; }
}

.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dashboard-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.dashboard-head span {
  color: #66737d;
}

.report-filter-panel.compact {
  margin-bottom: 0;
}

.graphic-dashboard {
  display: grid;
  gap: 14px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.dashboard-kpi {
  display: grid;
  gap: 4px;
  min-height: 96px;
  padding: 14px;
  color: white;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 34, 45, 0.12);
}

.dashboard-kpi b {
  font-size: 13px;
  opacity: 0.88;
}

.dashboard-kpi strong {
  font-size: 26px;
  line-height: 1.1;
}

.dashboard-kpi span {
  font-size: 12px;
  opacity: 0.82;
}

.dashboard-kpi.teal { background: #176b87; }
.dashboard-kpi.blue { background: #2f5f8f; }
.dashboard-kpi.orange { background: #c87918; }
.dashboard-kpi.green { background: #24734a; }
.dashboard-kpi.red { background: #b23b34; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.dashboard-panel {
  min-height: 260px;
  padding: 14px;
  background: white;
  border: 1px solid #d8dee3;
  border-radius: 8px;
}

.dashboard-panel.wide {
  grid-column: span 1;
}

.dashboard-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.dashboard-line {
  width: 100%;
  height: 190px;
  background: linear-gradient(180deg, #f7fbfd, #ffffff);
  border: 1px solid #e0e7ec;
  border-radius: 8px;
}

.dashboard-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: #66737d;
  font-size: 12px;
}

.dashboard-donut {
  display: block;
  width: 190px;
  height: 190px;
  margin: 0 auto 10px;
  transform: rotate(-90deg);
}

.dashboard-legend {
  display: grid;
  gap: 6px;
}

.dashboard-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #33424c;
  font-size: 12px;
}

.dashboard-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.master-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-master-row > span:nth-child(12),
.product-master-row > span:nth-child(14) {
  white-space: pre-line;
  line-height: 1.35;
}

.product-master-row.master-header > span:nth-child(10),
.product-master-row.master-header > span:nth-child(11),
.product-master-row.master-header > span:nth-child(12),
.product-master-row.master-header > span:nth-child(13),
.product-master-row.master-header > span:nth-child(14) {
  white-space: pre-line;
  line-height: 1.25;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f5f8fa;
}

.master-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.master-actions button {
  min-height: 28px;
  padding: 0 7px;
  font-size: 12px;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
}

.split form {
  background: white;
  border: 1px solid #d8dee3;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.split h2 {
  margin: 0;
  font-size: 18px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #172026;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 32, 0.35);
}

#confirmModal {
  z-index: 1300;
}

.modal-panel {
  width: min(360px, calc(100vw - 36px));
  background: white;
  border: 1px solid #d8dee3;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.modal-panel p {
  margin: 0 0 16px;
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.missing-products-panel {
  width: min(560px, calc(100vw - 36px));
}

.missing-products-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.missing-products-panel textarea {
  width: 100%;
  min-height: 180px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #cbd5dc;
  border-radius: 4px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.order-limit-panel {
  width: min(520px, calc(100vw - 36px));
  text-align: center;
}

.order-limit-panel img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin: 0 auto 14px;
  border-radius: 8px;
}

.order-limit-panel p {
  color: #b91c1c;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 14px;
}

.quick-master-panel {
  width: min(760px, calc(100vw - 48px));
  max-width: 760px;
}

.quick-master-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
  color: #1f2b33;
}

.quick-master-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-master-fields label {
  display: grid;
  gap: 5px;
  color: #31424d;
  font-size: 13px;
  font-weight: 700;
}

.quick-master-fields label.wide {
  grid-column: span 2;
}

.quick-master-fields input,
.quick-master-fields select {
  min-height: 36px;
  border: 1px solid #cad5dd;
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  font-weight: 400;
  background: #fff;
}

.quick-master-fields input:focus,
.quick-master-fields select:focus {
  border-color: #176b87;
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
  outline: none;
}

.inventory-claim-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  max-height: none;
}

#inventoryClaimView {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.inventory-claim-section {
  height: 100%;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inventory-claim-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 760px;
}

.inventory-claim-grid-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  max-height: none;
}

.inventory-claim-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px 0;
  border-bottom: 1px solid #d8e3ea;
  background: #f8fbfc;
}

.inventory-claim-tabs button {
  border: 1px solid #c8d6de;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  padding: 8px 18px;
  background: #e8f0f4;
  color: #405865;
}

.inventory-claim-tabs button.active {
  background: #fff;
  color: #176b87;
  font-weight: 800;
  box-shadow: inset 0 3px 0 #176b87;
}

.inventory-claim-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  background: #eef7f1;
  border-bottom: 1px solid #d5e6da;
  color: #385747;
  font-size: 13px;
}

.inventory-claim-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #d8e3ea;
  background: #f8fbfc;
}

.inventory-claim-toolbar label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #31424d;
  font-weight: 700;
}

.inventory-claim-toolbar select,
.inventory-claim-toolbar input {
  height: 32px;
  min-width: 140px;
  border: 1px solid #cad5dd;
  border-radius: 4px;
  padding: 0 8px;
  background: #fff;
}

.inventory-claim-toolbar input {
  min-width: 210px;
}

.inventory-claim-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #536672;
  font-size: 13px;
  min-width: 430px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.inventory-claim-total-cost {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid #c9ddd0;
  border-radius: 5px;
  background: #eef7f1;
  color: #385747;
  white-space: nowrap;
}

.inventory-claim-total-cost span {
  font-size: 12px;
}

.inventory-claim-total-cost strong {
  color: #176b45;
  font-size: 16px;
}

.inventory-claim-actions > span {
  min-width: 72px;
  white-space: nowrap;
  text-align: right;
}

.inventory-claim-actions select {
  width: 190px;
  min-width: 190px;
}

.inventory-claim-actions button {
  min-width: 70px;
  white-space: nowrap;
}

.inventory-claim-table {
  width: 100%;
  min-width: 2200px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.inventory-claim-table th,
.inventory-claim-table td {
  border-right: 1px solid #e2eaf0;
  border-bottom: 1px solid #e2eaf0;
  padding: 5px 7px;
  line-height: 1.25;
  vertical-align: middle;
}

.inventory-claim-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef5f8;
  box-shadow: inset 0 -2px 0 #8fa8b7;
  text-align: left;
}

.inventory-claim-check-col {
  width: 42px;
  text-align: center !important;
}

.inventory-claim-code-col {
  width: 150px;
}

.inventory-claim-product-col {
  width: 260px;
}

.inventory-claim-product-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-claim-warehouse-col {
  width: 88px;
  min-width: 88px;
  white-space: nowrap;
}

.inventory-claim-qty-col,
.inventory-claim-updater-col,
.inventory-claim-date-col {
  width: 140px;
}

.inventory-claim-cost-col,
.inventory-claim-cost-cell {
  width: 130px;
  white-space: nowrap;
}

.inventory-claim-movement-summary-col,
.inventory-claim-movement-summary-cell {
  width: 205px;
  white-space: normal;
}

.inventory-claim-movement-summary-cell > span {
  display: block;
  margin-bottom: 2px;
}

.inventory-claim-movement-summary-cell > span:last-child {
  margin-bottom: 0;
}

.inventory-claim-movement-gap {
  color: #60747f;
  font-size: 12px;
}

.inventory-claim-staff-col,
.inventory-claim-staff-cell {
  width: 165px;
  min-width: 165px;
  white-space: normal;
}

.inventory-claim-allocation-qty-col,
.inventory-claim-allocation-qty-cell { width: 100px; }
.inventory-claim-purpose-col,
.inventory-claim-purpose-cell { width: 150px; }
.inventory-claim-deadline-col,
.inventory-claim-deadline-cell { width: 130px; }
.inventory-claim-note-col,
.inventory-claim-note-cell { width: 190px; white-space: normal; }
.inventory-claim-overdue-value { color: #bd2525; font-weight: 800; }
.inventory-claim-missing-info { color: #b36b00; font-weight: 800; }
.inventory-claim-metadata-missing-row:not(.inventory-claim-unassigned-row) td { background: #fff8df; }

.inventory-claim-staff-cell,
.inventory-claim-allocation-qty-cell,
.inventory-claim-purpose-cell,
.inventory-claim-deadline-cell,
.inventory-claim-note-cell,
.inventory-claim-date-cell {
  vertical-align: top !important;
}

.inventory-claim-inline-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inventory-claim-inline-line {
  display: flex;
  align-items: center;
  min-height: 30px;
}

.inventory-claim-inline-line input,
.inventory-claim-inline-line select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

.inventory-claim-inline-line input:disabled,
.inventory-claim-inline-line select:disabled {
  opacity: 1;
  color: #394b55;
  background: #f3f6f8;
}

.inventory-claim-inline-new input,
.inventory-claim-inline-new select {
  border-color: #83b9ca;
  background: #f5fcff;
}

.inventory-claim-inline-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  margin-top: 5px;
}

.inventory-claim-inline-footer small {
  color: #2d7a50;
  line-height: 1.2;
}

.inventory-claim-inline-footer small.error {
  color: #bd2525;
}

.inventory-claim-movement-col {
  width: 92px;
}

.inventory-claim-change-col {
  min-width: 250px;
  white-space: normal;
}

.inventory-claim-change-cell {
  white-space: normal;
}

.inventory-claim-change-cell > span {
  display: block;
  margin-bottom: 2px;
}

.inventory-claim-change-cell > span:last-child {
  margin-bottom: 0;
}

.inventory-claim-bulk-panel { width: min(520px, 92vw); }
.inventory-claim-bulk-panel > label { display: grid; gap: 6px; margin: 12px 0; }
.inventory-claim-bulk-panel select,
.inventory-claim-bulk-panel input,
.inventory-claim-bulk-panel textarea { width: 100%; }

.inventory-claim-movement-time-col {
  width: 150px;
}

.inventory-movement-in,
.inventory-movement-out {
  display: inline-block;
  min-width: 42px;
  padding: 2px 7px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.inventory-movement-in {
  background: #e3f5e9;
  color: #247346;
}

.inventory-movement-out {
  background: #fff0df;
  color: #a85b13;
}

.inventory-claim-unassigned-row td {
  background: #ffe5e5;
  color: #8b2020;
}

.inventory-claim-monthly-unconfirmed-row td {
  background: #fff5cf;
  color: #694d00;
}

.inventory-claim-monthly-unconfirmed-row td:first-child {
  box-shadow: inset 4px 0 0 #e3a312;
}

.inventory-claim-table th:last-child,
.inventory-claim-table td:last-child {
  border-right: 0;
}

.inventory-claim-table .empty-cell {
  text-align: center;
  color: #6b7b86;
  padding: 22px;
}

.inventory-claim-empty-staff {
  color: #8a99a3;
}

.inventory-claim-staff-name {
  color: #174a5d;
  font-weight: 700;
}

.packing-tool-layout {
  max-width: 1280px;
  display: grid;
  gap: 12px;
}

.packing-tool-card {
  background: #fff;
  border: 1px solid #cfdbe3;
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(24, 45, 60, 0.06);
}

.packing-tool-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.packing-tool-card p {
  margin: 0 0 12px;
  color: #607080;
}

.packing-input-label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.packing-list-input {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid #c7d5df;
  border-radius: 4px;
  padding: 10px;
  font-family: Consolas, "Yu Gothic UI", monospace;
  line-height: 1.55;
}

.packing-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.packing-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.packing-result-head h2 {
  margin: 0;
}

.packing-result-head span {
  color: #176b87;
  font-weight: 700;
}

.packing-table-wrap {
  max-height: calc(100vh - 410px);
  overflow: auto;
  border: 1px solid #d8e4eb;
  border-radius: 4px;
}

.packing-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: #fff;
}

.packing-list-table th,
.packing-list-table td {
  border-right: 1px solid #e0e8ee;
  border-bottom: 1px solid #e0e8ee;
  padding: 8px;
  vertical-align: middle;
  word-break: break-word;
}

.packing-list-table th {
  position: sticky;
  top: 0;
  background: #eef5f8;
  box-shadow: inset 0 -2px 0 #8fa8b7;
  z-index: 1;
}

.packing-col-barcode {
  width: 145px;
}

.packing-col-image {
  width: 72px;
}

.packing-col-price {
  width: 95px;
}

.packing-col-name {
  width: auto;
}

.packing-col-case {
  width: 90px;
}

.packing-col-size {
  width: 75px;
}

.packing-col-weight {
  width: 115px;
}

.packing-col-box {
  width: 115px;
}

.packing-image-cell {
  text-align: center;
}

.packing-image-cell img {
  display: inline-block;
  width: 57px;
  height: 57px;
  object-fit: contain;
  background: #fff;
}

.packing-list-table tr.packing-missing td {
  background: #fff4f4;
  color: #a33434;
  font-weight: 700;
}

.nav-badge {
  float: right;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  font-weight: 800;
}

.todo-view {
  max-width: 1500px;
  margin: 0 auto;
}

.todo-view button,
.todo-detail-panel button,
.todo-editor-panel button,
.todo-reminder-panel button {
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0;
  line-height: 1.25;
  text-indent: 0;
  white-space: nowrap;
}

#createTodoButton {
  min-width: 118px;
  min-height: 38px;
  font-size: 14px;
}

.todo-list-head button {
  min-width: 54px;
  min-height: 34px;
  font-size: 13px;
}

.todo-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.todo-page-head h2 {
  margin: 0 0 5px;
  color: #20313d;
  font-size: 23px;
}

.todo-page-head p {
  margin: 0;
  color: #71808b;
  font-size: 13px;
}

.todo-status-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.todo-status-cards.admin-cards {
  grid-template-columns: repeat(4, minmax(165px, 1fr));
}

.todo-status-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 94px;
  padding: 16px 18px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: #31434f;
  text-align: left;
  box-shadow: 0 5px 18px rgba(34, 57, 70, 0.08);
}

.todo-status-card:hover {
  transform: translateY(-1px);
  border-color: #94bfce;
}

.todo-status-card.active {
  border-color: #2384a1;
  background: #edf8fb;
}

.todo-status-card.overdue.active {
  border-color: #d94b4b;
  background: #fff2f2;
}

.todo-status-card.completed.active {
  border-color: #2f9c68;
  background: #effaf4;
}

.todo-status-card span {
  font-size: 14px;
  font-weight: 800;
}

.todo-status-card strong {
  grid-row: span 2;
  font-size: 32px;
  color: #176b87;
}

.todo-status-card.overdue strong { color: #c93e3e; }
.todo-status-card.completed strong { color: #27865a; }

.todo-status-card small {
  color: #86949d;
  font-size: 11px;
}

.todo-list-panel {
  overflow: hidden;
  border: 1px solid #d4dde3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(34, 57, 70, 0.06);
}

.todo-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid #dce4e9;
  background: #f5f9fb;
}

.todo-table-scroll {
  max-height: calc(100vh - 300px);
}

.todo-table {
  min-width: 900px;
}

.todo-table.manage-table {
  min-width: 1500px;
}

.todo-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf1f5;
}

.todo-table td {
  vertical-align: middle;
}

.todo-table tr.todo-row-unread td {
  background: #f0f9fd;
}

.todo-table tr.todo-row-overdue td {
  background: #fff4f4;
}

.todo-title-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f4f63;
  text-align: left;
  font-weight: 800;
}

.todo-title-button:hover {
  color: #0d7b9e;
  text-decoration: underline;
}

.todo-list-subtext {
  display: block;
  max-width: 420px;
  margin-top: 3px;
  overflow: hidden;
  color: #7b8992;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-table .todo-list-subtext {
  max-width: none;
  overflow: visible;
  line-height: 1.45;
  text-overflow: clip;
  white-space: normal;
}

.manage-table .todo-published-date {
  display: block;
  margin-top: 1px;
  white-space: nowrap;
}

.todo-pending-names {
  color: #8a5a00;
  font-weight: 600;
}

.todo-completed-names {
  color: #237d51;
  font-weight: 700;
}

.manage-table th:nth-child(6),
.manage-table td:nth-child(6) {
  width: 180px;
}

.manage-table th:nth-child(7),
.manage-table td:nth-child(7) {
  width: 220px;
}

.manage-table th:nth-child(9),
.manage-table td:nth-child(9) {
  width: 180px;
}

.manage-table .inline-actions {
  flex-wrap: nowrap;
}

.manage-table .todo-pending-names,
.manage-table .todo-completed-names {
  overflow: visible;
  line-height: 1.55;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.todo-priority,
.todo-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.todo-priority.normal { background: #edf1f4; color: #61717c; }
.todo-priority.important { background: #fff1d8; color: #a46600; }
.todo-priority.urgent { background: #ffe1e1; color: #b52e2e; }
.todo-state-badge.pending { background: #e8f3fa; color: #176b87; }
.todo-state-badge.overdue { background: #ffe3e3; color: #bd3030; }
.todo-state-badge.completed { background: #e1f6ea; color: #237d51; }

.todo-deadline.overdue {
  color: #bf3030;
  font-weight: 800;
}

.todo-progress {
  display: grid;
  grid-template-columns: 90px auto;
  gap: 7px;
  align-items: center;
}

.todo-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7eb;
}

.todo-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2b9b68;
}

.todo-progress small { white-space: nowrap; }

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.inline-actions button {
  min-width: 46px;
  min-height: 34px;
  padding: 5px 9px;
  font-size: 13px;
}

.todo-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.todo-mail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dce4e9;
}

.todo-mail-subject {
  min-width: 0;
}

.todo-mail-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}

.todo-mail-kicker > span:first-child {
  color: #6f7e87;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.todo-mail-subject h2 {
  margin: 0;
  color: #172b36;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.35;
}

.todo-modal-head h2 {
  display: inline;
  margin: 0 0 0 8px;
  color: #20313d;
  font-size: 20px;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: #e8eef2;
  color: #44555f;
  font-size: 22px;
  line-height: 1;
}

#addOrderItemButton,
.order-item-actions .remove-item {
  border-color: #b93a3a;
  background: #b93a3a;
  color: #fff;
}

#addOrderItemButton:hover,
.order-item-actions .remove-item:hover {
  border-color: #922f2f;
  background: #922f2f;
  color: #fff;
}

.todo-detail-panel,
.todo-editor-panel {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 24px 28px;
}

#todoDetailModal.todo-detail-floating-layer {
  display: block;
  background: transparent;
  pointer-events: none;
}

.todo-detail-floating-layer .todo-detail-panel {
  position: absolute;
  top: 12px;
  left: 50%;
  min-width: min(560px, calc(100vw - 28px));
  min-height: 320px;
  transform: translateX(-50%);
  resize: both;
  pointer-events: auto;
  box-shadow: 0 16px 52px rgba(17, 38, 49, 0.28);
}

.todo-detail-floating-layer .todo-mail-head {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.todo-detail-floating-layer .todo-mail-head:active,
body.todo-detail-dragging {
  cursor: grabbing;
}

@media (max-width: 620px) {
  .todo-detail-floating-layer .todo-detail-panel {
    min-width: calc(100vw - 28px);
    resize: none;
  }
}

.todo-detail-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
  padding: 14px 0;
  border-bottom: 1px solid #e1e7eb;
}

.todo-mail-meta-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  align-content: center;
}

.todo-mail-meta-lines > div {
  display: grid;
  gap: 3px;
}

.todo-mail-meta-lines small {
  color: #87949c;
  font-size: 12px;
  font-weight: 700;
}

.todo-mail-meta-lines b {
  max-width: 260px;
  overflow: hidden;
  color: #3d4d56;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-deadline-highlight {
  display: grid;
  gap: 4px;
  min-width: 225px;
  padding: 12px 16px;
  border: 1px solid #f1d39a;
  border-left: 4px solid #dc9b2c;
  border-radius: 7px;
  background: #fff9ee;
}

.todo-deadline-highlight small {
  color: #91641e;
  font-size: 13px;
  font-weight: 800;
}

.todo-deadline-highlight strong {
  color: #7e4d00;
  font-size: 21px;
  line-height: 1.25;
  white-space: nowrap;
}

.todo-deadline-highlight.overdue {
  border-color: #efb7b7;
  border-left-color: #c83e3e;
  background: #fff2f2;
}

.todo-deadline-highlight.overdue small,
.todo-deadline-highlight.overdue strong {
  color: #ac2e2e;
}

.todo-mail-section {
  padding: 18px 0 16px;
}

.todo-mail-section h3 {
  margin: 0 0 10px;
  color: #263b47;
  font-size: 17px;
  font-weight: 800;
}

.todo-detail-content {
  min-height: 180px;
  padding: 18px 20px;
  border: 1px solid #cfdbe2;
  border-left: 4px solid #4e91a8;
  border-radius: 7px;
  background: #fbfdfe;
  color: #1d2f39;
  font-size: 18px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.todo-detail-attachments {
  margin-bottom: 16px;
  padding: 10px 0;
  border-top: 1px solid #e1e7eb;
  border-bottom: 1px solid #e1e7eb;
}

.todo-detail-attachments:empty {
  display: none;
}

.todo-attachment-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #425660;
  font-size: 14px;
}

.todo-attachment-head small {
  color: #8a979e;
}

.todo-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.todo-attachment-link {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 320px;
  min-height: 36px;
  padding: 4px 9px 4px 5px;
  border: 1px solid #d7e0e5;
  border-radius: 5px;
  background: #f7f9fa;
  color: #31596b;
  text-decoration: none;
  overflow: hidden;
}

.todo-attachment-link:hover {
  border-color: #91b7c5;
  background: #eef7fa;
}

.todo-attachment-link img {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
}

.todo-file-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  background: #dfeaf0;
  color: #46616e;
  font-size: 9px;
  font-weight: 800;
}

.todo-file-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-attachment-link small {
  flex: 0 0 auto;
  color: #88959c;
  font-size: 10px;
}

.todo-completion-note {
  margin-bottom: 15px;
  padding-top: 2px;
}

.todo-completion-note > span {
  color: #344b57;
  font-size: 15px;
  font-weight: 800;
}

.todo-completion-note > span small {
  color: #8a969d;
  font-weight: 400;
}

.todo-completion-note textarea {
  min-height: 100px;
  font-size: 16px;
}

.todo-editor-panel {
  display: grid;
  gap: 16px;
}

.todo-editor-panel .todo-modal-head h2 {
  font-size: 26px;
}

.todo-editor-panel > label,
.todo-editor-grid label,
#todoAudienceFields > label,
.todo-reapply-field,
.todo-completion-note {
  display: grid;
  gap: 6px;
  color: #40515c;
  font-size: 14px;
  font-weight: 800;
}

.todo-reapply-field {
  padding: 12px 14px;
  border: 1px solid #d7c78f;
  border-radius: 7px;
  background: #fffbed;
}

.todo-reapply-field small {
  color: #766a45;
  font-weight: 500;
}

.todo-editor-panel textarea,
.todo-completion-note textarea {
  resize: vertical;
}

.todo-editor-panel input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]),
.todo-editor-panel select,
.todo-editor-panel textarea {
  min-height: 42px;
  font-size: 16px;
}

.todo-editor-panel textarea {
  min-height: 150px;
  line-height: 1.65;
}

.todo-paste-image-hint {
  color: #71818a;
  font-size: 12px;
}

.todo-content-editor {
  min-height: 220px;
  max-height: 52vh;
  padding: 16px 18px;
  overflow: auto;
  border: 1px solid #bfcdd5;
  border-left: 4px solid #4e91a8;
  border-radius: 7px;
  background: #fbfdfe;
  color: #1d2f39;
  font-size: 17px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.todo-content-editor:focus,
.todo-content-editor:focus-within {
  border-color: #2783a0;
  outline: 2px solid rgba(39, 131, 160, 0.16);
}

.todo-content-editor:empty::before {
  color: #8b989f;
  content: attr(data-placeholder);
  pointer-events: none;
}

.todo-content-text-block {
  min-height: 1.75em;
  outline: none;
  white-space: pre-wrap;
}

.todo-content-text-block:focus {
  background: rgba(255, 255, 255, 0.7);
}

.todo-content-editor > .todo-content-text-block:only-child:empty::before {
  color: #8b989f;
  content: attr(data-placeholder);
  pointer-events: none;
}

.todo-inline-image {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 14px 0;
}

.todo-inline-image img {
  display: block;
  max-width: min(100%, 760px);
  max-height: 560px;
  border: 1px solid #d1dce2;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.todo-inline-image.is-editable {
  cursor: pointer;
}

.todo-inline-image.is-selected img {
  border-color: #1680a1;
  box-shadow: 0 0 0 3px rgba(22, 128, 161, 0.2);
}

.todo-inline-image-selection-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: -2px;
  color: #526873;
  font-size: 13px;
}

.todo-inline-image-selection-bar button {
  min-height: 30px;
  height: 30px;
  padding: 0 11px;
  background: #b32f2f;
  font-size: 13px;
}

.todo-detail-content .todo-inline-image img {
  cursor: zoom-in;
}

.todo-detail-content .todo-inline-image.is-expanded {
  width: 100%;
}

.todo-detail-content .todo-inline-image.is-expanded img {
  width: 100%;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.todo-editor-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

.todo-deadline-inputs {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 70px 10px 70px;
  gap: 6px;
  align-items: center;
}

.todo-deadline-inputs b {
  color: #52626c;
  text-align: center;
  font-size: 16px;
}

.todo-recipient-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 7px;
  max-height: 170px;
  margin-top: 8px;
  padding: 10px;
  overflow: auto;
  border: 1px solid #d5dfe5;
  border-radius: 7px;
  background: #f8fafb;
}

.todo-recipient-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.todo-recipient-picker input { width: auto; }

.todo-selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.todo-selected-files > span {
  max-width: 220px;
  padding: 5px 8px;
  overflow: hidden;
  border-radius: 5px;
  background: #edf3f6;
  color: #53636d;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-selected-files .todo-selected-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 300px;
  padding: 4px 5px;
}

.todo-selected-file img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 4px;
  object-fit: cover;
}

.todo-selected-file b {
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-selected-file button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: #bf4141;
  line-height: 1;
}

.todo-selected-files .todo-existing-file-count {
  background: #f2f5f7;
  color: #667780;
}

.todo-reminder-panel {
  width: min(440px, calc(100vw - 36px));
  text-align: center;
}

.todo-reminder-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #dff4e8;
  color: #27865a;
  font-size: 28px;
  font-weight: 900;
}

.todo-reminder-panel h2 { margin: 0 0 8px; }
.todo-reminder-panel .modal-actions { justify-content: center; }

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .filter-panel, .form-grid, .split {
    grid-template-columns: 1fr;
  }

  .todo-status-cards,
  .todo-status-cards.admin-cards,
  .todo-editor-grid {
    grid-template-columns: 1fr;
  }

  .todo-detail-meta {
    grid-template-columns: 1fr;
  }

  .todo-deadline-highlight {
    min-width: 0;
  }

  th, td {
    font-size: 12px;
    padding: 6px;
  }
}
.violation-approval-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  text-align: left;
}

.violation-approval-field input,
.violation-approval-field textarea {
  width: 100%;
  box-sizing: border-box;
}

.violation-approval-field textarea {
  min-height: 90px;
  resize: vertical;
}

.violation-warning {
  max-height: 240px;
  overflow: auto;
  color: #9b1c1c;
  text-align: left;
}

.violation-log-filters {
  align-items: end;
}

.violation-reason-cell {
  min-width: 220px;
  white-space: normal;
}
.order-load-more-row td {
  padding: 14px;
  text-align: center;
  color: #607482;
  background: #f4f8fa;
  font-weight: 600;
}
