:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #647181;
  --line: #dbe4ea;
  --panel: #ffffff;
  --bg: #f3f6f8;
  --nav: #102838;
  --nav-active: #1f465a;
  --blue: #235789;
  --teal: #1a8a8f;
  --green: #2f8f5b;
  --amber: #b67518;
  --red: #b44747;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
a {
  font: inherit;
}

.sidebar {
  min-height: 100vh;
  padding: 18px 14px;
  background: var(--nav);
  color: #eef6f8;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 4px 18px;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #36b6ad;
  color: #09212a;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: #a9c0c8;
}

nav {
  display: grid;
  gap: 6px;
}

nav button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbdce2;
  text-align: left;
  cursor: pointer;
}

nav button.active,
nav button:hover {
  background: var(--nav-active);
  color: #ffffff;
}

main {
  min-width: 0;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

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

h1 {
  font-size: 24px;
}

h2 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
}

.topbar p,
.hero-copy p,
.panel-head span,
small {
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions button,
.ghost-button,
.small-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.top-actions button,
.ghost-button {
  padding: 8px 13px;
}

#syncButton {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.small-button {
  padding: 6px 10px;
}

.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-root {
  display: grid;
  gap: 16px;
}

.hero-band {
  display: grid;
  grid-template-columns: 1.5fr 0.75fr;
  gap: 24px;
  align-items: center;
  min-height: 238px;
  padding: 28px;
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(16, 40, 56, 0.94), rgba(26, 138, 143, 0.78)),
    url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: #ffffff;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #bfe9e8;
}

.hero-copy p {
  max-width: 820px;
  margin-top: 12px;
  color: #e6f2f4;
  line-height: 1.7;
}

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

.hero-metrics div {
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  font-size: 32px;
}

.hero-metrics span {
  margin-top: 8px;
  color: #e6f4f4;
}

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

.metric-grid article,
.panel,
.warehouse-card,
.shipment-card,
.mapping-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-grid article {
  min-height: 96px;
  padding: 15px;
}

.metric-grid span,
.metric-grid strong,
small {
  display: block;
}

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

.metric-grid strong {
  margin-top: 9px;
  font-size: 27px;
}

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

.panel {
  padding: 16px;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

td small {
  margin-top: 4px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.ok {
  color: #0e5f39;
  background: #dff3e8;
}

.badge.info {
  color: #20537d;
  background: #e2edf7;
}

.badge.watch {
  color: #855510;
  background: #fff0cc;
}

.badge.risk {
  color: #8c2f2f;
  background: #ffe1df;
}

.warehouse-list,
.shipment-grid,
.mapping-grid {
  display: grid;
  gap: 12px;
}

.warehouse-card,
.shipment-card,
.mapping-card {
  padding: 14px;
}

.warehouse-card strong,
.warehouse-card span,
.warehouse-card b,
.shipment-card strong,
.shipment-card span,
.mapping-card strong,
.mapping-card span,
.mapping-card p {
  display: block;
}

.warehouse-card span,
.shipment-card span,
.mapping-card span,
.mapping-card p {
  margin-top: 5px;
  color: var(--muted);
}

.bar {
  height: 8px;
  margin: 14px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf1;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

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

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

dl {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 7px 10px;
  margin: 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

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

.mapping-card em {
  display: inline-flex;
  margin: 8px 6px 0 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef3f5;
  color: #314756;
  font-style: normal;
  font-size: 12px;
}

.flow {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 4px;
}

.flow span {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.flow i {
  flex: 0 0 32px;
  height: 1px;
  background: var(--line);
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

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

.event-item strong {
  display: block;
  margin: 4px 0;
}

.event-item p {
  color: #344553;
}

@media (max-width: 1180px) {
  .metric-grid,
  .mapping-grid,
  .shipment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

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

  nav button {
    text-align: center;
  }

  .hero-band,
  .split-grid,
  .metric-grid,
  .mapping-grid,
  .shipment-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  main {
    padding: 14px;
  }

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

  .hero-band {
    padding: 20px;
  }

  h2 {
    font-size: 24px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}
