:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --ink: #16202a;
  --muted: #64748b;
  --line: #dce5ef;
  --brand: #1456f0;
  --brand-dark: #0e3fae;
  --teal: #14a38b;
  --amber: #f59e0b;
  --danger: #dc2626;
  --success: #15965c;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
  --radius: 8px;
  --sidebar: #101827;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(20, 86, 240, 0.75);
  box-shadow: 0 0 0 4px rgba(20, 86, 240, 0.1);
}

.table-check {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--brand);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #f8fafc;
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 12px 24px rgba(20, 86, 240, 0.22);
}

.button.primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.button.ghost {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.button.danger {
  color: #fff;
  background: var(--danger);
}

.button.text {
  min-height: auto;
  padding: 0;
  color: var(--muted);
  background: transparent;
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.danger-text {
  color: var(--danger) !important;
}

.text-link {
  color: var(--brand);
  font-weight: 700;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--teal));
  font-weight: 900;
}

.brand-mark.image-mark {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.panel,
.stat-card,
.login-panel {
  border: 1px solid rgba(220, 229, 239, 0.95);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.public-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fff;
}

.home-main {
  --home-flow-start: 620px;
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
}

.home-main::before,
.home-main::after {
  content: '';
  position: absolute;
  right: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

.home-main::before {
  top: calc(var(--home-flow-start) - 1px);
  bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(91, 155, 214, 0.08) 0 1px, transparent 1px 128px),
    repeating-linear-gradient(0deg, rgba(67, 190, 185, 0.06) 0 1px, transparent 1px 104px),
    radial-gradient(circle at 14% 0%, rgba(6, 21, 38, 0.84), transparent 34%),
    radial-gradient(circle at 66% 4%, rgba(186, 82, 86, 0.28), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(24, 84, 128, 0.38), transparent 34%),
    radial-gradient(circle at 18% 88%, rgba(20, 163, 139, 0.17), transparent 36%),
    linear-gradient(180deg, rgba(7, 19, 34, 0.92) 0%, rgba(10, 36, 60, 0.76) 18%, rgba(66, 132, 174, 0.34) 48%, rgba(217, 234, 246, 0.96) 76%, rgba(232, 242, 252, 0.98) 100%);
}

.home-main::after {
  top: calc(var(--home-flow-start) - 160px);
  bottom: -160px;
  background:
    radial-gradient(circle at 18% 24%, rgba(101, 228, 203, 0.72) 0 3px, rgba(101, 228, 203, 0.2) 4px 14px, transparent 22px),
    radial-gradient(circle at 36% 58%, rgba(93, 173, 235, 0.58) 0 3px, rgba(93, 173, 235, 0.18) 4px 16px, transparent 24px),
    radial-gradient(circle at 62% 32%, rgba(255, 166, 121, 0.38) 0 3px, rgba(255, 166, 121, 0.14) 4px 15px, transparent 24px),
    radial-gradient(circle at 84% 68%, rgba(101, 228, 203, 0.56) 0 3px, rgba(101, 228, 203, 0.16) 4px 16px, transparent 24px),
    linear-gradient(118deg, transparent 0%, transparent 22%, rgba(101, 228, 203, 0.28) 27%, rgba(93, 173, 235, 0.36) 31%, rgba(101, 228, 203, 0.18) 35%, transparent 41%, transparent 56%, rgba(255, 166, 121, 0.2) 61%, rgba(93, 173, 235, 0.28) 66%, transparent 74%),
    linear-gradient(104deg, transparent 0%, transparent 40%, rgba(84, 185, 238, 0.18) 45%, rgba(101, 228, 203, 0.24) 49%, transparent 56%, transparent 100%),
    linear-gradient(0deg, transparent 0%, rgba(20, 163, 139, 0.2) 36%, rgba(68, 148, 220, 0.26) 52%, transparent 76%);
  opacity: 0.92;
  animation: home-route-flow 13s linear infinite;
}

.home-flow-bridge {
  position: absolute;
  display: block;
  top: calc(var(--home-flow-start) - 1px);
  right: 0;
  left: 0;
  z-index: 0;
  height: 190px;
  pointer-events: none;
}

.home-flow-bridge::before,
.home-flow-bridge::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-flow-bridge::before {
  background: var(--home-flow-image, url("/assets/hero-logistics.png")) center bottom / cover no-repeat;
  opacity: calc(var(--home-flow-image-opacity, 1) * 0.98);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.84) 38%, rgba(0, 0, 0, 0.34) 74%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.84) 38%, rgba(0, 0, 0, 0.34) 74%, transparent 100%);
}

.home-flow-bridge::after {
  background:
    linear-gradient(180deg, rgba(8, 21, 38, 0.12), rgba(8, 21, 38, 0.58) 54%, rgba(10, 36, 60, 0.08) 100%),
    radial-gradient(circle at 63% 18%, rgba(210, 102, 91, 0.2), transparent 28%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0 6vw;
  border-bottom: 1px solid rgba(220, 229, 239, 0.75);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 700;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--brand);
  background: rgba(20, 86, 240, 0.08);
}

.hero-section {
  position: relative;
  z-index: 2;
  isolation: isolate;
  overflow: hidden;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 6vw 120px;
  background: #081526;
}

.hero-section::before,
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-section::before {
  z-index: 0;
  background: var(--hero-image, url("/assets/hero-logistics.png")) center / cover no-repeat;
  opacity: var(--hero-image-opacity, 1);
}

.hero-section::after {
  z-index: 1;
  background: linear-gradient(90deg, rgba(8, 21, 38, 0.78) 0%, rgba(8, 21, 38, 0.56) 42%, rgba(8, 21, 38, 0.08) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  color: #fff;
}

.hero-content .eyebrow {
  color: #65e4cb;
}

.hero-content h1,
.page-hero h1 {
  margin: 0;
  font-size: 52px;
  line-height: 1.08;
}

.hero-copy {
  max-width: 580px;
  margin: 20px 0 32px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

.tracking-search {
  display: flex;
  width: min(660px, 100%);
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.2);
}

.tracking-search input {
  min-height: 50px;
  border-color: transparent;
  background: #f8fafc;
  font-size: 16px;
}

.tracking-search button {
  min-height: 50px;
}

.tracking-search .scan-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: rgba(20, 86, 240, 0.28);
  background: #eef5ff;
  color: var(--brand) !important;
  white-space: nowrap;
}

.tracking-search .scan-trigger:hover:not(:disabled) {
  background: #e3eeff;
  box-shadow: 0 10px 20px rgba(20, 86, 240, 0.12);
}

.scan-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.scan-icon::before,
.scan-icon::after {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 999px;
  background: currentColor;
}

.scan-icon::before {
  top: 4px;
  height: 2px;
}

.scan-icon::after {
  bottom: 4px;
  height: 2px;
  opacity: 0.55;
}

.public-band,
.result-section,
.content-band,
.metric-strip {
  padding: 64px 6vw;
}

.public-band {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  background: var(--home-feature-bg-base, #fff);
}

.public-band::before,
.public-band::after,
.page-hero::before,
.metric-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.public-band::before {
  background: var(--home-feature-bg-image, none);
  opacity: var(--home-feature-bg-opacity, 0);
}

.public-band::after {
  display: none;
}

.public-band-flow {
  background:
    radial-gradient(circle at 14% 0%, rgba(6, 21, 38, 0.84), transparent 34%),
    radial-gradient(circle at 66% 4%, rgba(186, 82, 86, 0.28), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(24, 84, 128, 0.38), transparent 34%),
    radial-gradient(circle at 18% 88%, rgba(20, 163, 139, 0.17), transparent 36%),
    linear-gradient(180deg, rgba(7, 19, 34, 0.92) 0%, rgba(10, 36, 60, 0.76) 18%, rgba(66, 132, 174, 0.34) 48%, rgba(217, 234, 246, 0.96) 76%, rgba(232, 242, 252, 0.98) 100%);
}

.public-band-flow::before,
.public-band-flow::after {
  inset: -18% 0;
}

.public-band-flow::before {
  background:
    repeating-linear-gradient(90deg, rgba(112, 182, 236, 0.18) 0 1px, transparent 1px 86px),
    repeating-linear-gradient(0deg, rgba(48, 194, 184, 0.13) 0 1px, transparent 1px 64px),
    linear-gradient(115deg, transparent 0%, rgba(54, 142, 210, 0.22) 46%, rgba(225, 113, 92, 0.12) 54%, transparent 62%);
  opacity: 0.78;
  animation: result-flow-up 14s linear infinite;
}

.public-band-flow::after {
  display: block;
  background:
    linear-gradient(0deg, transparent 0%, rgba(20, 163, 139, 0.22) 34%, rgba(68, 148, 220, 0.24) 50%, rgba(224, 112, 94, 0.16) 62%, transparent 76%),
    linear-gradient(90deg, transparent 0%, rgba(78, 158, 220, 0.2) 42%, rgba(244, 146, 103, 0.12) 62%, transparent 100%);
  opacity: 0.82;
  animation: result-light-up 9s ease-in-out infinite;
}

.public-band > *,
.page-hero > *,
.metric-strip > * {
  position: relative;
  z-index: 1;
}

.band-grid,
.result-layout,
.two-column,
.section-card-grid,
.admin-grid,
.stat-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.band-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.section-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.band-grid article,
.section-card-grid article {
  min-height: 180px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.image-backed-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.image-backed-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--card-bg, none) center / cover no-repeat;
  opacity: var(--card-bg-opacity, 0);
  pointer-events: none;
}

.image-backed-card > * {
  position: relative;
  z-index: 1;
}

.feature-card {
  display: flex;
  flex-direction: column;
}

.table-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.table-image-preview {
  width: 74px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.band-grid span {
  color: var(--teal);
  font-weight: 900;
}

.band-grid h2,
.section-card-grid h2,
.content-band h2,
.timeline h2,
.section-title h2 {
  margin: 10px 0 8px;
  font-size: 22px;
}

.band-grid p,
.section-card-grid p,
.content-band p,
.page-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.result-section {
  position: relative;
  z-index: 1;
  padding-top: 20px;
  padding-bottom: 20px;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 92%, rgba(20, 163, 139, 0.18), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(20, 86, 240, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(244, 248, 252, 0.94), rgba(232, 242, 252, 0.98));
}

.home-main > .result-section,
.home-main > .public-band-flow {
  background: transparent;
}

.home-main > .result-section::before,
.home-main > .result-section::after,
.home-main > .public-band-flow::before,
.home-main > .public-band-flow::after {
  display: none;
}

.result-section::before,
.result-section::after {
  content: '';
  position: absolute;
  inset: -18% 0;
  z-index: 0;
  pointer-events: none;
}

.result-section::before {
  background:
    repeating-linear-gradient(90deg, rgba(20, 86, 240, 0.16) 0 1px, transparent 1px 86px),
    repeating-linear-gradient(0deg, rgba(20, 163, 139, 0.14) 0 1px, transparent 1px 64px),
    linear-gradient(115deg, transparent 0%, rgba(20, 86, 240, 0.16) 48%, transparent 58%);
  opacity: 0.72;
  animation: result-flow-up 14s linear infinite;
}

.result-section::after {
  background:
    linear-gradient(0deg, transparent 0%, rgba(20, 163, 139, 0.26) 38%, rgba(20, 86, 240, 0.18) 52%, transparent 74%),
    linear-gradient(90deg, transparent 0%, rgba(20, 86, 240, 0.18) 48%, transparent 100%);
  opacity: 0.78;
  animation: result-light-up 9s ease-in-out infinite;
}

.result-section > * {
  position: relative;
  z-index: 1;
}

.result-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  align-items: start;
  gap: 20px;
}

@keyframes result-flow-up {
  from {
    transform: translateY(110px);
  }

  to {
    transform: translateY(-110px);
  }
}

@keyframes home-route-flow {
  from {
    transform: translate3d(-18px, 130px, 0);
  }

  to {
    transform: translate3d(18px, -130px, 0);
  }
}

@keyframes result-light-up {
  0% {
    transform: translateY(42%);
  }

  100% {
    transform: translateY(-42%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-main::after,
  .public-band-flow::before,
  .public-band-flow::after,
  .result-section::before,
  .result-section::after {
    animation: none;
  }
}

.result-summary,
.timeline {
  padding: 18px 22px;
}

.timeline {
  display: flex;
  height: var(--result-card-height, min(560px, calc(100vh - 160px)));
  max-height: var(--result-card-height, min(560px, calc(100vh - 160px)));
  flex-direction: column;
}

.timeline h2 {
  margin: 0 0 6px;
  line-height: 1.18;
}

.timeline-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.28) transparent;
}

.timeline-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.timeline-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.28);
  background-clip: padding-box;
}

.timeline-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.42);
}

.trace-table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.trace-table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.45);
  background-clip: padding-box;
}

.result-summary h2 {
  margin: 0 0 12px;
  word-break: break-word;
}

.result-summary .eyebrow {
  margin-bottom: 8px;
}

.public-miss-card {
  display: grid;
  gap: 8px;
  text-align: left;
}

.public-miss-card strong {
  color: #0f172a;
  font-size: 20px;
}

.public-miss-card p,
.public-miss-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.status-advice {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  margin: 10px 0 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.status-advice span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-advice strong {
  font-size: 15px;
}

.status-advice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.advice-tone-muted {
  border-color: #dbe3ed;
  background: #f8fafc;
}

.advice-tone-info {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.advice-tone-primary {
  border-color: #c7d8ff;
  background: #f4f8ff;
}

.advice-tone-warning {
  border-color: #f8d891;
  background: #fff9eb;
}

.advice-tone-success {
  border-color: #bdebd7;
  background: #f0fdf6;
}

.advice-tone-danger {
  border-color: #fecaca;
  background: #fff5f5;
}

.summary-row > span:not(.status-badge),
.contact-grid span {
  color: var(--muted);
  font-size: 13px;
}

.contact-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.contact-grid div {
  padding: 13px 14px;
  border-radius: var(--radius);
  background: #f8fafc;
}

.contact-grid strong {
  display: block;
  margin: 6px 0 3px;
}

.contact-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.timeline-item {
  --timeline-node-color: #94a3b8;
  --timeline-node-glow: rgba(100, 116, 139, 0.16);
  --timeline-latest-title: #0f172a;
  display: grid;
  position: relative;
  grid-template-columns: 140px 26px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0 0;
}

.timeline-tone-muted {
  --timeline-node-color: #64748b;
  --timeline-node-glow: rgba(100, 116, 139, 0.16);
  --timeline-latest-title: #334155;
}

.timeline-tone-info {
  --timeline-node-color: #0284c7;
  --timeline-node-glow: rgba(14, 165, 233, 0.18);
  --timeline-latest-title: #075985;
}

.timeline-tone-primary {
  --timeline-node-color: #2563eb;
  --timeline-node-glow: rgba(37, 99, 235, 0.18);
  --timeline-latest-title: #1d4ed8;
}

.timeline-tone-warning {
  --timeline-node-color: #d97706;
  --timeline-node-glow: rgba(245, 158, 11, 0.22);
  --timeline-latest-title: #92400e;
}

.timeline-tone-success {
  --timeline-node-color: #059669;
  --timeline-node-glow: rgba(16, 185, 129, 0.18);
  --timeline-latest-title: #047857;
}

.timeline-tone-danger {
  --timeline-node-color: #dc2626;
  --timeline-node-glow: rgba(239, 68, 68, 0.18);
  --timeline-latest-title: #b91c1c;
}

.timeline-item time {
  padding-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.timeline-node {
  position: relative;
  display: block;
  min-height: 100%;
}

.timeline-node::before {
  content: '';
  position: absolute;
  top: 20px;
  bottom: -18px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(20, 163, 139, 0.32), rgba(20, 86, 240, 0.2));
}

.timeline-node::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border: 3px solid #fff;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.2);
}

.timeline-item.is-last .timeline-node::before {
  display: none;
}

.timeline-item.is-latest .timeline-node::after {
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--timeline-node-color);
  box-shadow: 0 0 0 5px var(--timeline-node-glow);
}

.timeline-content {
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.timeline-item.is-last .timeline-content {
  border-bottom: 0;
}

.timeline-content .status-badge {
  margin-bottom: 2px;
}

.timeline-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.latest-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.timeline-item.is-latest .latest-tag {
  border-color: currentColor;
  background: var(--timeline-node-glow);
  color: var(--timeline-latest-title);
}

.timeline-item h3 {
  margin: 7px 0 4px;
  font-size: 17px;
}

.timeline-item.is-latest h3 {
  color: var(--timeline-latest-title);
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.content-page {
  background: #fff;
}

.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 86px 6vw 56px;
  background: var(--page-hero-bg-base, linear-gradient(135deg, #eef6ff, #f8fbfc 52%, #effaf7));
}

.page-hero::before {
  background: var(--page-hero-bg-image, none);
  opacity: var(--page-hero-bg-opacity, 0);
}

.page-hero > * {
  width: min(980px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.compact-hero p:last-child {
  max-width: 760px;
  margin-top: 16px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}

.metric-strip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  width: min(980px, calc(100% - 12vw));
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin: 0 auto 72px;
  border-radius: var(--radius);
  background: var(--metric-strip-bg-base, var(--sidebar));
  color: #fff;
}

.metric-strip::before {
  background: var(--metric-strip-bg-image, none);
  opacity: var(--metric-strip-bg-opacity, 0);
}

.metric-strip div {
  display: grid;
  gap: 6px;
  text-align: center;
}

.metric-strip strong {
  font-size: 34px;
}

.metric-strip span {
  color: rgba(255, 255, 255, 0.68);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.88), rgba(20, 86, 240, 0.72)),
    url("/assets/hero-logistics.png") center / cover no-repeat;
}

.login-panel {
  width: min(430px, 100%);
  padding: 34px;
}

.login-panel h1 {
  margin: 30px 0 22px;
  font-size: 30px;
}

.stack-form,
.grid-form {
  display: grid;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.required-label::after {
  content: ' *';
  color: var(--danger);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px 1fr;
  background: var(--bg);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  color: #fff;
  background: var(--sidebar);
}

.admin-menu-backdrop,
.admin-menu-button {
  display: none;
}

.admin-brand {
  padding: 0 8px;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav a,
.nav-placeholder {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.admin-nav a.active,
.admin-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-placeholder {
  opacity: 0.45;
}

.sidebar-user {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-user span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.admin-topbar h1 {
  margin: 0;
  font-size: 28px;
}

.admin-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-content {
  padding: 28px 32px 42px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 20px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  font-size: 34px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 22px;
  min-width: 0;
}

.settings-form textarea {
  min-height: 96px;
}

.settings-form small,
.field-help {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.page-manager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.manager-guide {
  display: grid;
  gap: 10px;
}

.manager-guide h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.manager-guide > button {
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  color: var(--brand);
  background: rgba(20, 86, 240, 0.08);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.manager-guide > button:hover {
  background: rgba(20, 86, 240, 0.13);
}

.guide-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.guide-note strong {
  display: block;
  margin-bottom: 6px;
}

.guide-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.manager-main,
.settings-stack {
  display: grid;
  gap: 18px;
}

.page-manager-intro .section-title {
  margin-bottom: 6px;
}

.settings-block {
  scroll-margin-top: 120px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.sub-section-title {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.selection-hint {
  min-height: 22px;
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 180px auto auto;
  gap: 10px;
  margin-bottom: 18px;
}

.toolbar.single {
  grid-template-columns: minmax(260px, 480px);
}

.trace-lookup {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 12px;
}

.shipment-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 420px;
  padding: 8px;
  margin-bottom: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.shipment-picker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  text-align: left;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
}

.shipment-picker-item:hover,
.shipment-picker-item.active {
  border-color: rgba(21, 96, 255, 0.32);
  background: #f2f6ff;
}

.shipment-picker-item.active {
  border-color: rgba(220, 38, 38, 0.48);
  background: #fff5f5;
  box-shadow: inset 4px 0 0 var(--danger), 0 10px 24px rgba(220, 38, 38, 0.12);
}

.shipment-picker-item.active .shipment-picker-main strong {
  color: var(--danger);
}

.shipment-picker-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shipment-picker-item .status-badge {
  justify-self: end;
  min-height: 22px;
  padding: 0 8px;
}

.shipment-picker-main strong,
.shipment-picker-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-picker-main span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-template-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.quick-template-bar label {
  display: grid;
  gap: 8px;
}

.quick-template-bar label span {
  margin: 0;
}

.status-bars {
  display: grid;
  gap: 14px;
}

.status-bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 36px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--teal));
}

.simple-list {
  display: grid;
}

.simple-list a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.simple-list span {
  color: var(--muted);
  text-align: right;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.table-wrap table {
  min-width: 860px;
}

.status-update-table {
  table-layout: fixed;
}

.status-update-table .status-col-check {
  width: 52px;
}

.status-update-table .status-col-no {
  width: 150px;
}

.status-update-table .status-col-change {
  width: 260px;
}

.status-update-table .status-col-template {
  width: 280px;
}

.status-update-table .status-col-content {
  width: 260px;
}

.status-update-table .status-col-action {
  width: 110px;
}

.admin-scroll-table,
.trace-table-wrap {
  max-height: min(520px, calc(100vh - 320px));
  overflow: auto;
}

.admin-scroll-table thead th,
.trace-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--line);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-muted {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.6;
}

.exception-reason-cell strong {
  display: block;
  color: var(--ink);
  font-weight: 800;
}

.exception-note-cell {
  color: var(--muted);
}

.status-template-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-change-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
}

.status-arrow {
  color: var(--muted);
  font-weight: 900;
}

.status-template-content {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.status-template-location,
.status-template-description {
  display: block;
  max-width: 360px;
}

.account-grid {
  align-items: start;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  color: var(--muted);
}

.pagination div {
  display: flex;
  gap: 8px;
}

.shipment-overview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: #f8fafc;
}

.shipment-overview span:last-child {
  color: var(--muted);
}

.shipment-overview strong {
  color: var(--danger);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tone-muted {
  color: #526071;
  background: #eef2f7;
}

.tone-info {
  color: #075985;
  background: #e0f2fe;
}

.tone-primary {
  color: #1d4ed8;
  background: #e8f0ff;
}

.tone-warning {
  color: #a15c00;
  background: #fff3d6;
}

.tone-success {
  color: #047857;
  background: #dff8ed;
}

.tone-danger {
  color: #b91c1c;
  background: #fee2e2;
}

.empty-state {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-state.compact {
  width: 100%;
  padding: 18px;
  box-shadow: none;
}

.empty-state.warning {
  border-color: #fed7aa;
  color: #9a3412;
  background: #fff7ed;
}

.page-error {
  margin-top: 80px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.52);
}

.modal {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

.modal.narrow {
  width: min(520px, 100%);
}

.qr-scan-modal,
.qr-code-modal {
  display: grid;
  gap: 16px;
}

.scan-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.scan-panel {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.9), rgba(20, 86, 240, 0.58)),
    #101827;
}

.qr-video {
  width: 100%;
  height: 320px;
  display: block;
  object-fit: cover;
}

.qr-canvas {
  display: none;
}

.scan-frame {
  position: absolute;
  inset: 62px;
  border: 2px solid rgba(101, 228, 203, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.32), 0 0 28px rgba(101, 228, 203, 0.38);
  pointer-events: none;
}

.scan-frame::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 14px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #65e4cb, transparent);
  animation: scan-line 1.8s ease-in-out infinite;
}

.scan-upload {
  display: none;
  place-items: center;
  min-height: 320px;
  padding: 28px;
  color: #fff;
  text-align: center;
}

.scan-upload input {
  width: min(320px, 100%);
  padding: 14px;
  border-style: dashed;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.scan-upload p {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

.scan-panel.is-file-mode .qr-video,
.scan-panel.is-file-mode .scan-frame {
  display: none;
}

.scan-panel.is-file-mode .scan-upload {
  display: grid;
}

.scan-message {
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #075985;
  background: #e0f2fe;
  font-weight: 700;
  text-align: center;
}

.scan-message.error {
  color: #9a3412;
  background: #fff7ed;
}

.qr-preview {
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.qr-preview img {
  width: min(260px, 100%);
  aspect-ratio: 1;
  display: block;
  border-radius: var(--radius);
  background: #fff;
}

@keyframes scan-line {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(170px);
  }
}

.grid-form {
  grid-template-columns: repeat(2, 1fr);
}

.shipment-form {
  display: grid;
  gap: 18px;
}

.shipment-form-group {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.shipment-form-group.first {
  padding-top: 0;
  border-top: 0;
}

.form-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-group-heading h3 {
  margin: 0;
  font-size: 15px;
}

.form-group-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.input-with-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.address-book-picker {
  display: grid;
  gap: 8px;
}

.template-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.template-picker > span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.template-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(20, 86, 240, 0.18);
  border-radius: 999px;
  color: var(--brand);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.template-chip:hover {
  background: rgba(20, 86, 240, 0.08);
}

.image-upload-row .button {
  white-space: nowrap;
}

.backup-card,
.import-result {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.backup-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.backup-card strong {
  word-break: break-word;
}

.import-result {
  border-color: rgba(20, 163, 139, 0.3);
  background: #effaf7;
}

.import-result p {
  margin: 0;
  color: var(--muted);
}

.import-errors {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  padding-top: 8px;
  color: #9a3412;
  font-size: 13px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.check-row span {
  margin: 0;
}

.full-row {
  grid-column: 1 / -1;
}

.icon-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.print-modal {
  width: min(1080px, 100%);
}

.print-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.print-waybill {
  display: grid;
  gap: 16px;
  min-height: 220px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  background: #fff;
}

.waybill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.waybill-head strong {
  font-size: 22px;
  letter-spacing: 0;
}

.waybill-body {
  display: grid;
  grid-template-columns: 1fr 1fr 118px;
  gap: 14px;
  align-items: start;
}

.waybill-body span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.waybill-body p {
  margin: 0 0 6px;
  line-height: 1.55;
}

.waybill-body img {
  width: 118px;
  height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 48px));
  padding: 14px 16px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--sidebar);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 1120px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-grid,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-row: 1;
  }

  .result-summary {
    grid-row: 2;
  }

  .timeline {
    height: auto;
    max-height: min(560px, calc(100vh - 160px));
  }
}

@media (max-width: 900px) {
  .site-header {
    position: static;
    flex-wrap: wrap;
    padding: 16px 5vw;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .home-main {
    --home-flow-start: 560px;
  }

  .hero-section {
    min-height: 560px;
    padding: 64px 5vw 80px;
  }

  .hero-content h1,
  .page-hero h1 {
    font-size: 40px;
  }

  .band-grid,
  .section-card-grid,
  .two-column,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(320px, 86vw);
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: 20px 0 55px rgba(15, 23, 42, 0.24);
  }

  .admin-layout.admin-menu-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .admin-layout.admin-menu-open .admin-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-menu-button {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .sidebar-user {
    margin-top: auto;
  }

  .admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .admin-title-row {
    min-width: 0;
    gap: 8px;
  }

  .admin-title-row > div {
    min-width: 0;
  }

  .admin-title-row .eyebrow {
    display: none;
  }

  .admin-topbar h1 {
    overflow: hidden;
    font-size: 20px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-menu-button,
  .topbar-actions .button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .admin-topbar,
  .admin-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .page-manager-layout {
    grid-template-columns: 1fr;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .quick-template-bar {
    grid-template-columns: 1fr 1fr;
  }

  .admin-content .table-wrap {
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] thead {
    display: none;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] tbody {
    display: grid;
    gap: 10px;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] tr {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 2px 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td {
    grid-column: 2;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    padding: 5px 0;
    border-bottom: 0;
    word-break: break-word;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6px;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td:first-child::before,
  .admin-content .table-wrap table[data-mobile-labels="true"] td[colspan]::before {
    display: none;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td[colspan] {
    grid-column: 1 / -1;
    display: block;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td > * {
    min-width: 0;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] .row-actions,
  .admin-content .table-wrap table[data-mobile-labels="true"] .status-change-line {
    min-width: 0;
    flex-wrap: wrap;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] .status-template-content,
  .admin-content .table-wrap table[data-mobile-labels="true"] .status-template-location,
  .admin-content .table-wrap table[data-mobile-labels="true"] .status-template-description,
  .admin-content .table-wrap table[data-mobile-labels="true"] .cell-muted {
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .hero-content h1,
  .page-hero h1 {
    font-size: 34px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .tracking-search {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }

  .tracking-search input {
    grid-column: 1 / -1;
    min-height: 46px;
  }

  .tracking-search button {
    min-height: 44px;
    padding: 0 12px;
  }

  .public-band,
  .result-section,
  .content-band,
  .metric-strip {
    padding: 42px 5vw;
  }

  .result-section {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .result-layout {
    gap: 14px;
  }

  .result-summary,
  .timeline {
    padding: 16px;
  }

  .result-summary h2 {
    margin-bottom: 8px;
    font-size: 22px;
  }

  .summary-row {
    gap: 12px;
    padding: 8px 0;
  }

  .status-advice {
    gap: 4px;
    padding: 11px 12px;
    margin-top: 8px;
  }

  .contact-grid {
    gap: 8px;
    margin-top: 10px;
  }

  .contact-grid div {
    padding: 11px 12px;
  }

  .timeline {
    max-height: min(520px, calc(100vh - 120px));
  }

  .timeline h2 {
    font-size: 20px;
  }

  .timeline-scroll {
    padding-right: 4px;
  }

  .timeline-item {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 6px 10px;
    padding-top: 12px;
  }

  .timeline-item time {
    grid-column: 2;
    padding-top: 0;
  }

  .timeline-node {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .timeline-content {
    grid-column: 2;
    padding-bottom: 12px;
  }

  .timeline-item h3 {
    margin-top: 6px;
    font-size: 16px;
  }

  .latest-tag {
    min-height: 22px;
    padding: 0 7px;
    font-size: 11px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .trace-lookup {
    grid-template-columns: 1fr;
  }

  .shipment-picker {
    grid-template-columns: 1fr;
    max-height: 360px;
  }

  .quick-template-bar {
    grid-template-columns: 1fr;
  }

  .admin-content .table-wrap {
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] thead {
    display: none;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] tbody {
    display: grid;
    gap: 10px;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] tr {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 2px 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td {
    grid-column: 2;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    padding: 5px 0;
    border-bottom: 0;
    word-break: break-word;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6px;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td:first-child::before,
  .admin-content .table-wrap table[data-mobile-labels="true"] td[colspan]::before {
    display: none;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td[colspan] {
    grid-column: 1 / -1;
    display: block;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] td > * {
    min-width: 0;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] .row-actions,
  .admin-content .table-wrap table[data-mobile-labels="true"] .status-change-line {
    min-width: 0;
    flex-wrap: wrap;
  }

  .admin-content .table-wrap table[data-mobile-labels="true"] .status-template-content,
  .admin-content .table-wrap table[data-mobile-labels="true"] .status-template-location,
  .admin-content .table-wrap table[data-mobile-labels="true"] .status-template-description,
  .admin-content .table-wrap table[data-mobile-labels="true"] .cell-muted {
    max-width: none;
    min-width: 0;
  }

  .section-title,
  .pagination,
  .shipment-overview,
  .simple-list a {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions {
    justify-content: stretch;
  }

  .section-actions .button {
    flex: 1;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .input-with-button {
    grid-template-columns: 1fr;
  }

  .scan-panel,
  .qr-video,
  .scan-upload {
    min-height: 280px;
    height: 280px;
  }

  .scan-frame {
    inset: 48px;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: auto;
    margin-left: auto;
  }

  .topbar-actions .button {
    flex: 0 0 auto;
  }

  .waybill-body {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .print-backdrop,
  .print-backdrop * {
    visibility: visible;
  }

  .print-backdrop {
    position: static;
    display: block;
    padding: 0;
    background: #fff;
  }

  .print-modal {
    width: 100%;
    max-height: none;
    overflow: visible;
    padding: 0;
    box-shadow: none;
  }

  .no-print {
    display: none !important;
  }

  .print-area {
    grid-template-columns: repeat(2, 1fr);
    gap: 10mm;
  }

  .print-waybill {
    break-inside: avoid;
    page-break-inside: avoid;
    border-color: #111827;
    box-shadow: none;
  }
}
