:root {
  color-scheme: light;
  --bg: #eef4f6;
  --page: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #d9e2ec;
  --line-strong: #c5d1df;
  --text: #18212c;
  --muted: #687686;
  --faint: #9aa7b5;
  --primary: #00a086;
  --primary-dark: #056a5e;
  --primary-soft: #ddf7f1;
  --blue: #244f8f;
  --blue-soft: #e6effb;
  --green: #14754b;
  --green-soft: #e7f4ed;
  --amber: #9a6a16;
  --amber-soft: #f8f0dc;
  --red: #b2413d;
  --red-soft: #f9ecea;
  --ink: #0d1825;
  --nav: #091a2d;
  --nav-2: #17283a;
  --gold: #a88442;
  --gold-soft: #f4ecd9;
  --shadow: 0 20px 48px rgba(17, 29, 43, 0.08);
  --shadow-soft: 0 10px 26px rgba(17, 29, 43, 0.055);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(0, 160, 134, 0.13), transparent 360px),
    linear-gradient(180deg, #e7f2f3 0, var(--page) 320px),
    linear-gradient(90deg, rgba(15, 122, 114, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(40, 91, 147, 0.04) 1px, transparent 1px),
    var(--page);
  background-size: auto, 42px 42px, 42px 42px, auto;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body.locked {
  overflow: hidden;
}

body.locked .app-shell {
  visibility: hidden;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.58;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 160, 134, 0.22);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background:
    linear-gradient(135deg, rgba(168, 132, 66, 0.1) 0 1px, transparent 1px),
    linear-gradient(180deg, #102d48 0, #071522 100%);
  background-size: 26px 26px, auto;
  color: #fff;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 11px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background:
    linear-gradient(135deg, #f7fffb 0, #d9f2ec 100%);
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.14);
}

.brand-mark svg,
.nav-icon svg,
.top-icon svg,
.metric-icon svg,
.import-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand strong,
.brand span,
.system-note b,
.system-note span,
.nav-copy,
.nav-copy b,
.nav-copy small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.15;
}

.brand span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 9px;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section-title {
  display: block;
  padding: 0 9px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.nav-section-items {
  display: grid;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 5px 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nav-copy b {
  font-weight: 800;
  line-height: 1.25;
}

.nav-copy small {
  display: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-item.active {
  background:
    linear-gradient(135deg, #ffffff 0, #f4faf8 100%);
  color: var(--nav);
  box-shadow: 0 14px 30px rgba(3, 13, 24, 0.22);
}

.nav-item.active::before {
  background: var(--primary);
}

.nav-item.active .nav-icon {
  background:
    linear-gradient(135deg, #e8f7f4 0, #d6ece8 100%);
  color: var(--primary-dark);
}

.nav-item.active .nav-copy small {
  color: var(--muted);
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(217, 226, 236, 0.86);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0, rgba(239, 250, 247, 0.94) 55%, rgba(246, 249, 252, 0.96) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.topbar::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 280px;
  height: 220px;
  background:
    linear-gradient(135deg, rgba(15, 122, 114, 0.12) 0 1px, transparent 1px),
    linear-gradient(45deg, rgba(185, 150, 80, 0.1) 0 1px, transparent 1px);
  background-size: 18px 18px, 28px 28px;
  transform: rotate(8deg);
  pointer-events: none;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.date-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.date-field input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.date-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 160, 134, 0.12);
  outline: none;
}

.server-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.server-badge.offline {
  background: var(--red-soft);
  color: var(--red);
}

.user-chip {
  display: grid;
  gap: 2px;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px 12px;
  background: #fff;
  white-space: nowrap;
}

.account-bar .secondary-btn {
  min-width: 84px;
  white-space: nowrap;
}

.user-chip b {
  font-size: 13px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary-soft), #f4efdf);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.eyebrow.dark {
  background: rgba(255, 255, 255, 0.15);
  color: #e9fffb;
}

h1 {
  font-size: 31px;
  line-height: 1.16;
}

h2 {
  font-size: 24px;
  line-height: 1.25;
}

h3 {
  font-size: 17px;
  line-height: 1.3;
}

.subtext,
.screen-head p,
.panel-head span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.subtext {
  margin-top: 8px;
}

.top-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  min-width: 380px;
}

.top-status div,
.date-chip {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.top-status div {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 10px;
  overflow: hidden;
  padding: 13px 14px;
  backdrop-filter: blur(8px);
}

.top-status div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}

.top-status div:nth-child(2)::before {
  background: var(--blue);
}

.top-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e5f4f1, #d7ebe7);
  color: var(--primary-dark);
}

.top-status div:nth-child(2) .top-icon {
  background: linear-gradient(135deg, var(--blue-soft), #e4edf7);
  color: var(--blue);
}

.top-status b,
.top-status span {
  display: block;
}

.top-status b {
  margin-bottom: 5px;
  color: var(--text);
}

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

.screen {
  display: none;
}

.screen.active {
  display: grid;
  gap: 20px;
}

.screen-head,
.panel-head,
.table-tools,
.head-actions,
.period-tabs,
.report-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.head-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.report-query-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.period-tabs,
.report-tabs {
  justify-content: flex-start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.period-tabs button,
.report-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.period-tabs button.active,
.report-tabs button.active {
  background: var(--primary);
  color: #fff;
}

.report-tabs {
  width: fit-content;
}

.period-query {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.period-step,
.period-current {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.period-step {
  width: 40px;
  padding: 0;
  font-size: 25px;
  line-height: 1;
  color: var(--primary-dark);
}

.period-current {
  padding: 0 13px;
  color: var(--primary-dark);
}

.period-step:hover,
.period-current:hover {
  border-color: rgba(0, 160, 134, 0.42);
  background: var(--primary-soft);
}

.period-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 11px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.period-picker input {
  width: 128px;
  height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.period-picker input[type="month"] {
  width: 108px;
}

.period-picker input[type="number"] {
  width: 62px;
}

.screen-head {
  border-bottom: 1px solid rgba(197, 209, 223, 0.78);
  padding-bottom: 12px;
}

.date-chip {
  flex: 0 0 auto;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 14px;
}

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

.metric,
.panel,
.import-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0, #fbfcfe 100%);
  box-shadow: var(--shadow-soft);
}

.operations-board {
  display: grid;
  gap: 18px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 160, 134, 0.22);
  border-radius: 20px;
  padding: 22px;
  background:
    linear-gradient(135deg, #102d48 0%, #0b6058 58%, #0f766e 100%);
  color: #fff;
  box-shadow: 0 22px 52px rgba(9, 26, 45, 0.18);
}

.operations-board::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 330px;
  height: 260px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px);
  background-size: 22px 22px, 34px 34px;
  transform: rotate(10deg);
}

.operations-board > * {
  position: relative;
  z-index: 1;
}

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

.operations-board h3 {
  max-width: 680px;
  font-size: 24px;
  line-height: 1.35;
}

.operations-board span {
  max-width: 720px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.7;
}

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

.workbench-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.workbench-card i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.workbench-card i svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workbench-card b,
.workbench-card strong,
.workbench-card span {
  display: block;
}

.workbench-card b {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.workbench-card strong {
  font-size: 26px;
  line-height: 1;
}

.workbench-card span {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  line-height: 1.45;
}

.secondary-light-btn {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 900;
}

.operations-board .primary-btn {
  border-color: #fff;
  background: #fff;
  color: var(--primary-dark);
  box-shadow: none;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, var(--primary-soft), #f2f8f6);
  color: var(--primary-dark);
  flex: 0 0 auto;
}

.metric.warning .metric-icon {
  background: linear-gradient(135deg, var(--amber-soft), #fff9eb);
  color: var(--amber);
}

.metric.danger .metric-icon {
  background: linear-gradient(135deg, var(--red-soft), #fff7f6);
  color: var(--red);
}

.metric.info .metric-icon {
  background: linear-gradient(135deg, var(--blue-soft), #f4f8fc);
  color: var(--blue);
}

.metric.ok .metric-icon {
  background: linear-gradient(135deg, var(--green-soft), #f4fbf7);
  color: var(--green);
}

.metric strong {
  display: block;
  margin: 12px 0 7px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.metric small {
  color: var(--faint);
  line-height: 1.45;
}

.metric.warning::before {
  background: var(--amber);
}

.metric.danger::before {
  background: var(--red);
}

.metric.info::before {
  background: var(--blue);
}

.metric.ok::before {
  background: var(--green);
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(217, 226, 236, 0.72);
}

.wide {
  grid-column: span 2;
}

.content-grid {
  display: grid;
  gap: 20px;
}

.dashboard-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
}

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

.shipping-layout,
.inventory-layout,
.platform-layout,
.purchase-layout,
.analytics-layout,
.sync-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.75fr);
}

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

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

.shipping-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr) minmax(260px, 0.55fr);
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.process-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 15px;
  background: var(--surface-soft);
}

.process-card b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  margin-bottom: 12px;
  background: #e4ebf2;
  color: var(--muted);
  font-size: 13px;
}

.process-card span,
.process-card small {
  display: block;
}

.process-card span {
  font-weight: 900;
}

.process-card small {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.process-card.done {
  border-color: #cfe8d9;
  background: linear-gradient(180deg, #f5fffa, #ffffff);
}

.process-card.done b {
  background: var(--green-soft);
  color: var(--green);
}

.process-card.active {
  border-color: #cfe4e1;
  background: linear-gradient(180deg, #f1fbf9, #ffffff);
}

.process-card.active b {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.process-card.warn {
  border-color: #f1ddb9;
  background: linear-gradient(180deg, #fff9ee, #ffffff);
}

.process-card.warn b {
  background: var(--amber-soft);
  color: var(--amber);
}

.volume-list,
.alert-list,
.queue-list,
.timeline,
.status-list,
.platform-list,
.check-list,
.deploy-grid,
.module-summary {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.volume-list div,
.module-summary div,
.alert-item,
.queue-card,
.timeline-item,
.status-item,
.platform-card,
.check-list p,
.deploy-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background:
    linear-gradient(180deg, var(--surface-soft), #ffffff);
}

.volume-list div,
.module-summary div,
.status-item,
.deploy-grid div {
  position: relative;
  padding-left: 15px;
}

.volume-list div::before,
.module-summary div::before,
.status-item::before,
.deploy-grid div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.module-summary div {
  display: grid;
  gap: 5px;
  padding-left: 15px;
}

.module-summary span {
  color: var(--muted);
  line-height: 1.5;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.feature-strip div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(135deg, #ffffff 0, #f7fbfa 100%);
  box-shadow: var(--shadow-soft);
}

.feature-strip b,
.feature-strip span {
  display: block;
}

.feature-strip b {
  margin-bottom: 6px;
}

.feature-strip span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.combo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.combo-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px;
  background: linear-gradient(135deg, #ffffff 0, #f6fbfa 100%);
  box-shadow: var(--shadow-soft);
}

.combo-card b,
.combo-card span,
.combo-card p,
.combo-card small {
  display: block;
}

.combo-card span,
.combo-card p,
.combo-card small {
  color: var(--muted);
  line-height: 1.5;
}

.combo-card p {
  border-radius: 12px;
  padding: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

.empty-card {
  display: grid;
  gap: 6px;
  min-height: 88px;
  align-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  padding: 15px;
  color: var(--muted);
  background: #fafcfd;
}

.empty-card strong {
  color: var(--text);
}

.volume-list.horizontal {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.volume-list b,
.volume-list span,
.status-item b,
.status-item span,
.deploy-grid b,
.deploy-grid span {
  display: block;
}

.volume-list b,
.status-item b,
.deploy-grid b {
  margin-bottom: 6px;
}

.volume-list span,
.alert-item p,
.queue-card p,
.timeline-item span,
.status-item span,
.platform-card p,
.deploy-grid span {
  color: var(--muted);
  line-height: 1.55;
}

.alert-item strong,
.queue-card strong,
.platform-card strong {
  display: block;
  margin-bottom: 6px;
}

.status-more {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 11px 12px;
  text-align: left;
}

.status-more:hover {
  background: var(--primary-soft);
}

.timeline-more {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding-top: 12px;
}

.table-tools {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.table-tools input,
.table-tools select {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.table-tools input:focus,
.table-tools select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.table-tools input {
  width: min(360px, 100%);
}

.table-tools input[type="date"] {
  width: auto;
  min-width: 152px;
}

.filter-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.table-tools span {
  color: var(--muted);
  font-size: 14px;
}

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

table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
}

.finance-detail-table {
  min-width: 900px;
}

.finance-detail-table .cell-primary,
.finance-detail-table .cell-secondary {
  display: block;
}

.finance-detail-table .cell-secondary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}

.sku-table {
  min-width: 880px;
}

.binding-table {
  min-width: 790px;
}

.order-table {
  min-width: 1080px;
}

.sku-table .cell-primary,
.sku-table .cell-secondary,
.binding-table .cell-primary,
.binding-table .cell-secondary {
  display: block;
}

.sku-table .cell-secondary,
.binding-table .cell-secondary {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.sku-table .sku-components {
  min-width: 150px;
  max-width: 220px;
  white-space: normal;
  line-height: 1.5;
}

.action-cell {
  min-width: 86px;
}

.sku-table th:last-child,
.sku-table td:last-child,
.binding-table th:last-child,
.binding-table td:last-child,
.order-table th:last-child,
.order-table td:last-child {
  position: sticky;
  right: 0;
  box-shadow: -10px 0 14px -14px rgba(15, 23, 42, 0.5);
}

.sku-table th:last-child,
.binding-table th:last-child,
.order-table th:last-child {
  z-index: 2;
  background: #f3f6fa;
}

.sku-table td:last-child,
.binding-table td:last-child,
.order-table td:last-child {
  background: #fff;
}

.order-table tbody tr:hover td:last-child {
  background: #f8fbfd;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6fa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

td {
  font-size: 14px;
}

.empty-row {
  color: var(--muted);
  height: 72px;
  text-align: center;
}

.table-pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
}

.table-pagination span {
  white-space: nowrap;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f8fbfd;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tag.ok {
  background: var(--green-soft);
  color: var(--green);
}

.tag.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.bad {
  background: var(--red-soft);
  color: var(--red);
}

.tag.info {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag.gray {
  background: #eef2f6;
  color: var(--muted);
}

.primary-btn,
.secondary-btn,
.small-btn {
  border-radius: 12px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 900;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

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

.secondary-btn,
.small-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
}

.secondary-btn:hover,
.small-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-dark);
  box-shadow: var(--shadow-soft);
}

.small-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.small-btn.danger-btn {
  border-color: rgba(190, 58, 54, 0.22);
  color: var(--red);
}

.small-btn.danger-btn:hover:not(:disabled) {
  border-color: rgba(190, 58, 54, 0.48);
  background: var(--red-soft);
  color: var(--red);
}

.queue-card {
  display: grid;
  gap: 10px;
}

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

.queue-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.pick-lines {
  display: grid;
  gap: 7px;
  border-radius: 12px;
  padding: 9px;
  background: #eef7f5;
}

.pick-lines span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.queue-meta,
.queue-actions,
.platform-meta,
.capability-list,
.connector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.platform-state small {
  color: var(--muted);
  font-size: 12px;
}

.capability-list span {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.connector-list span {
  border-radius: 10px;
  padding: 7px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.platform-edit {
  margin-top: 11px;
}

.timeline-item {
  display: grid;
  gap: 5px;
}

.timeline.compact .timeline-item {
  padding: 10px 11px;
}

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

.shipping-stats {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.analysis-bars,
.reconcile-list,
.mapping-list,
.sync-log-list,
.result-list,
.finance-formula {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.bar-row,
.reconcile-item,
.mapping-item,
.sync-log-item,
.result-item,
.formula-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  background: linear-gradient(180deg, var(--surface-soft), #ffffff);
}

.bar-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bar-row b,
.bar-row span,
.reconcile-item b,
.reconcile-item span {
  display: block;
}

.bar-row span,
.reconcile-item span {
  color: var(--muted);
  font-size: 13px;
}

.bar-row i {
  display: block;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8eef4;
}

.bar-row em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.reconcile-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

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

.strategy-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  box-shadow: var(--shadow-soft);
}

.strategy-card i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.strategy-card i svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.strategy-card b,
.strategy-card span,
.result-item b,
.result-item span {
  display: block;
}

.strategy-card span,
.result-item span,
.sync-log-item p {
  color: var(--muted);
  line-height: 1.55;
}

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

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

.sync-log-item {
  display: grid;
  grid-template-columns: 120px 70px auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 16px;
  align-items: end;
}

.trend-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  box-shadow: var(--shadow-soft);
}

.trend-card b,
.trend-card span,
.trend-card strong,
.trend-card small {
  display: block;
}

.trend-card span,
.trend-card small {
  color: var(--muted);
  line-height: 1.45;
}

.trend-card strong {
  font-size: 20px;
}

.trend-card i {
  display: flex;
  align-items: end;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: #e8eef4;
}

.trend-card em {
  display: block;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--primary), var(--blue));
}

.finance-formula {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.formula-item {
  display: grid;
  gap: 7px;
}

.formula-item span,
.formula-item b,
.formula-item small {
  display: block;
}

.formula-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.formula-item b {
  font-size: 22px;
}

.formula-item small {
  color: var(--faint);
  line-height: 1.45;
}

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

.import-card {
  position: relative;
  padding: 17px;
}

.import-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--blue-soft), #f7f9fc);
  color: var(--blue);
}

.import-card b {
  display: block;
  margin-bottom: 8px;
}

.import-card p {
  min-height: 48px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.import-card button {
  margin-top: 14px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 32px));
  border-radius: 10px;
  padding: 13px 16px;
  background: #10202f;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(9, 26, 45, 0.94), rgba(8, 93, 85, 0.9)),
    var(--nav);
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  display: grid;
  gap: 16px;
  width: min(410px, 100%);
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 22px;
  padding: 27px;
  background: #fff;
  box-shadow: 0 32px 72px rgba(4, 14, 26, 0.34);
}

.auth-brand {
  border: 0;
  padding: 0;
  margin: 0 0 6px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.auth-brand span {
  color: var(--muted);
}

.auth-card p {
  color: var(--muted);
  font-size: 14px;
}

.auth-card label,
.form-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-card input,
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.form-field textarea {
  min-height: 84px;
  padding: 11px 12px;
  resize: vertical;
}

.auth-card input:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 160, 134, 0.12);
}

.auth-card .primary-btn {
  width: 100%;
  margin-top: 4px;
}

#loginMessage {
  min-height: 17px;
  color: var(--red);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(9, 26, 45, 0.5);
}

.modal-backdrop[hidden] {
  display: none;
}

.editor-modal {
  width: min(670px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow-y: auto;
  border-radius: 20px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(6, 20, 34, 0.28);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.icon-close {
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

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

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

.form-hint {
  grid-column: 1 / -1;
  border-radius: 12px;
  padding: 12px 13px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.55;
}

.form-hint a {
  margin-left: 8px;
  color: var(--primary-dark);
  font-weight: 900;
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 20px;
}

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

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

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

  .topbar,
  .screen-head {
    align-items: stretch;
    flex-direction: column;
  }

  .account-bar {
    justify-content: flex-end;
  }

  .top-status {
    min-width: 0;
  }

  .metrics-grid,
  .feature-strip,
  .strategy-grid,
  .finance.metrics-grid,
  .import-grid,
  .combo-grid,
  .three,
  .dashboard-layout,
  .shipping-layout,
  .inventory-layout,
  .platform-layout,
  .purchase-layout,
  .analytics-layout,
  .sync-layout,
  .finance-formula,
  .trend-grid,
  .volume-list.horizontal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operations-board {
    grid-template-columns: 1fr;
  }

  .board-head {
    flex-direction: column;
  }

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


  .wide {
    grid-column: span 2;
  }

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

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .sidebar {
    height: auto;
    max-height: none;
  }

  .brand {
    margin-bottom: 10px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .nav-section {
    display: contents;
  }

  .nav-section-title {
    display: none;
  }

  .nav-section-items {
    display: contents;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 112px;
    min-height: 58px;
    padding: 8px;
    scroll-snap-align: start;
  }

  .topbar {
    padding: 16px;
  }

  .account-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .date-field input {
    width: 100%;
  }

  .user-chip {
    min-width: 0;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 21px;
  }

  .top-status,
  .metrics-grid,
  .feature-strip,
  .strategy-grid,
  .finance.metrics-grid,
  .import-grid,
  .combo-grid,
  .three,
  .dashboard-layout,
  .shipping-layout,
  .inventory-layout,
  .platform-layout,
  .purchase-layout,
  .analytics-layout,
  .sync-layout,
  .finance-formula,
  .trend-grid,
  .process-flow,
  .volume-list.horizontal {
    grid-template-columns: 1fr;
  }

  .operations-board button {
    width: 100%;
  }

  .workbench-grid {
    grid-template-columns: 1fr;
  }


  .reconcile-item,
  .sync-log-item,
  .mapping-item {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }

  .screen-head,
  .panel-head,
  .table-tools,
  .head-actions,
  .report-query-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn,
  .date-chip,
  .period-tabs,
  .report-tabs,
  .period-query {
    justify-content: center;
    width: 100%;
  }

  .period-tabs button,
  .report-tabs button {
    flex: 1 1 0;
  }

  .period-picker {
    flex: 1 1 auto;
    justify-content: space-between;
  }

  .period-picker input {
    width: auto;
    min-width: 110px;
  }

  .panel {
    padding: 14px;
  }

  .metric strong {
    font-size: 24px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }

  .auth-card,
  .editor-modal {
    padding: 18px;
  }

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

  .nav-item {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 6px;
  }

  .nav-icon {
    width: 26px;
    height: 26px;
  }

  .nav-copy b {
    font-size: 14px;
    white-space: nowrap;
  }

  .table-pagination {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
    gap: 8px;
    justify-content: stretch;
  }

  .table-pagination .secondary-btn {
    min-width: 0;
    width: 100%;
  }

  .table-pagination span {
    align-self: center;
    font-size: 13px;
    justify-self: center;
  }
}
