:root {
  --navy: #0b1220;
  --navy-800: #111827;
  --accent: #3b82f6;
  --accent-600: #2563eb;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --white: #ffffff;
  --rose: #e11d48;
  --emerald: #059669;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
a, button { touch-action: manipulation; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: var(--slate-50);
  color: var(--navy);
  line-height: 1.5;
  font-size: 16px;
  max-width: 100%;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.tabular { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 16px;
  z-index: 80;
  background: var(--white);
  padding: 8px 12px;
  border-radius: 8px;
}

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226,232,240,0.9);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mark {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-size: 14px;
}
.nav {
  display: flex;
  gap: 24px;
}
.nav a {
  color: var(--slate-500);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--navy); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }
.nav-mobile-only { display: none; }
.signin { font-size: 14px; font-weight: 500; color: var(--slate-600); }
.signin:hover { color: var(--navy); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  transition: background 200ms, border-color 200ms, opacity 200ms;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, .input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-600); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-outline { background: var(--white); color: var(--navy); border: 1px solid var(--slate-200); }
.btn-outline:hover { border-color: var(--slate-300); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-block { width: 100%; }

.hero {
  background: var(--navy);
  color: var(--white);
}
.hero-grid {
  display: grid;
  gap: 48px;
  padding: 64px 0;
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1fr 1fr; padding: 96px 0; }
}
.kicker { font-size: 14px; font-weight: 500; color: #93c5fd; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -0.03em; margin: 12px 0 0; }
.lede { margin-top: 16px; max-width: 36rem; color: var(--slate-300); font-size: 16px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.demo-hint { margin-top: 16px; font-size: 12px; color: var(--slate-400); }

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); padding: 16px; box-shadow: none; }
.live-box { background: var(--navy-800); border-radius: 8px; padding: 16px; }
.live-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--slate-400); margin-bottom: 16px; }
.pill { border-radius: 999px; padding: 2px 8px; background: rgba(16,185,129,0.2); color: #6ee7b7; }
.live-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 12px 0;
  font-size: 14px;
}
.live-row span:last-child { color: #93c5fd; text-transform: capitalize; }
.muted { color: var(--slate-400); }

.section { padding: 56px 0; }
.section-white { background: var(--white); }
.grid-3 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.stat-card { padding: 24px; }
.stat { font-size: 30px; font-weight: 600; }
.stat-label { margin-top: 8px; font-size: 14px; color: var(--slate-500); }
h2 { font-size: 1.5rem; margin: 0; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; margin: 8px 0 0; }
.feature { border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 24px; }
.step-n { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; color: var(--accent); }
.sub { margin-top: 8px; font-size: 14px; color: var(--slate-500); max-width: 42rem; }
.link { color: var(--accent); font-size: 14px; font-weight: 500; display: inline-block; margin-top: 12px; }
.link:hover { text-decoration: underline; }

.pad { padding: 20px; }
.faq dt { font-weight: 600; margin-top: 16px; }
.faq dd { margin: 6px 0 0; color: var(--slate-600); font-size: 14px; }
.cta-band {
  background: var(--navy);
  color: var(--white);
  border-radius: 16px;
  padding: 48px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.cta-band p { color: var(--slate-300); max-width: 32rem; }

.site-footer { border-top: 1px solid var(--slate-200); background: var(--white); }
.footer-grid { display: grid; gap: 32px; padding: 40px 0; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } }
.foot-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate-400); }
.site-footer ul { list-style: none; padding: 0; margin: 12px 0 0; }
.site-footer li { margin: 8px 0; }
.site-footer a { color: var(--slate-600); font-size: 14px; }
.site-footer a:hover { color: var(--navy); }
.legal { border-top: 1px solid var(--slate-100); }
.legal p { margin: 0; padding: 16px 0; font-size: 12px; color: var(--slate-400); }

.page { padding: 64px 0; }
.prose { max-width: 48rem; }
.prose h2 { margin-top: 32px; }
.prose p, .prose li { max-width: 65ch; color: var(--slate-700); }
.prose code { background: var(--slate-100); border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.875em; }
.crumbs { font-size: 14px; color: var(--slate-500); }
.crumbs a:hover { color: var(--accent); }

.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 64px 16px; }
.auth-card { width: min(28rem, 100%); padding: 32px; }
.field { display: block; margin: 16px 0; }
.field span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--slate-700); }
.input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--white);
  color: var(--navy);
  font-size: 16px;
}
.hint { display: block; margin-top: 4px; font-size: 12px; color: var(--slate-500); }
.err { color: #e11d48; font-size: 14px; }
.ok { color: #047857; font-size: 14px; }
.tabs { display: flex; background: var(--slate-100); border-radius: 8px; padding: 4px; margin-top: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; min-height: 40px; border-radius: 6px; font-size: 14px; }
.tabs button.active { background: var(--white); box-shadow: var(--shadow); }

.app {
  min-height: 100dvh;
}
@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 240px 1fr; }
}
.sidebar {
  display: none;
  background: var(--navy);
  color: var(--white);
  flex-direction: column;
}
@media (min-width: 1024px) { .sidebar { display: flex; } }
.side-nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; flex: 1; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--slate-300);
  font-size: 14px;
  font-weight: 500;
}
.side-nav a:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.side-nav a.active { background: rgba(255,255,255,0.1); color: var(--white); }
.side-foot { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px; font-size: 12px; color: var(--slate-400); }
.app-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--slate-200);
  background: var(--white);
  padding: 12px 16px;
}
.search {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--slate-400);
}
.search input { padding-left: 36px; background: var(--slate-50); font-size: 16px; }
.app-main { padding: 16px; }
@media (min-width: 640px) { .app-main { padding: 24px; } }
.pagehead { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.pagehead h1 { font-size: 1.5rem; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; color: var(--slate-500); font-weight: 500; padding: 8px 16px; background: var(--slate-50); }
td { padding: 12px 16px; border-top: 1px solid var(--slate-100); }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}
.badge-pending { background: var(--slate-100); color: var(--slate-700); }
.badge-routed { background: #eff6ff; color: #1d4ed8; }
.badge-picking { background: #fffbeb; color: #92400e; }
.badge-shipped { background: #eef2ff; color: #3730a3; }
.badge-delivered, .badge-connected, .badge-active, .badge-sent { background: #ecfdf5; color: #047857; }
.badge-exception { background: #fff1f2; color: #be123c; }
.badge-owner { background: var(--navy); color: var(--white); }
.badge-ops_manager, .badge-3pl { background: #eff6ff; color: #1d4ed8; }
.badge-viewer { background: var(--slate-100); color: var(--slate-700); }
.badge-supplier { background: #f5f3ff; color: #6d28d9; }
.badge-warehouse { background: #f0fdfa; color: #0f766e; }
.empty {
  border: 1px dashed var(--slate-200);
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.skeleton { animation: pulse 1.2s ease-in-out infinite; background: rgba(226,232,240,0.7); border-radius: var(--radius); min-height: 96px; }
@keyframes pulse { 50% { opacity: 0.6; } }
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}
.icon-btn { border: 0; background: transparent; padding: 8px; border-radius: 8px; color: var(--slate-500); min-width: 44px; min-height: 44px; }
.icon-btn:hover { background: var(--slate-100); }
.drawer { position: fixed; inset: 0; z-index: 40; display: none; }
.drawer.open { display: block; }
.drawer-bg { position: absolute; inset: 0; background: rgba(11,18,32,0.5); border: 0; width: 100%; }
.drawer-panel { position: relative; width: 288px; height: 100%; background: var(--navy); color: var(--white); display: flex; flex-direction: column; }
.menu { position: relative; }
.menu-pop {
  position: absolute;
  right: 0;
  margin-top: 8px;
  width: 192px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 4px;
}
.menu-pop a, .menu-pop button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--slate-50); }
.avatar {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
}
.filters { display: grid; gap: 12px; padding: 16px; margin-bottom: 16px; }
@media (min-width: 768px) { .filters { grid-template-columns: repeat(4, 1fr); } }
.stack { display: grid; gap: 16px; }
@media (min-width: 1024px) { .cols-3 { grid-template-columns: 2fr 1fr; } .cols-2 { grid-template-columns: 1fr 1fr; } }
.kpis { display: grid; gap: 16px; }
@media (min-width: 640px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.mobile-only { display: inline-flex; }
@media (min-width: 1024px) { .mobile-only { display: none; } }
.desktop-only { display: none; }
@media (min-width: 640px) { .desktop-only { display: inline; } }
svg.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.calc-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .calc-grid { grid-template-columns: 1fr 1fr; } }
.calc-out { background: var(--slate-50); border-radius: 8px; padding: 16px; }
.who-list { margin: 16px 0 0; padding-left: 20px; color: var(--slate-600); }
.who-list li { margin: 6px 0; }
.spark { width: 100%; height: 144px; display: block; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 44px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.divide { list-style: none; padding: 0; margin: 12px 0 0; }
.divide li { border-top: 1px solid var(--slate-100); padding: 12px 0; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.preview-shell { padding: 24px; }
.preview-inner { background: var(--white); border-radius: 12px; padding: 24px; }
.steps { display: flex; justify-content: space-between; gap: 8px; margin-top: 24px; font-size: 12px; color: var(--slate-500); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; word-break: break-all; }
.card-title { font-size: 14px; font-weight: 600; padding: 16px 20px; }
.gap-stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; }
.center-page { max-width: 32rem; margin: 0 auto; padding: 96px 16px; text-align: center; }

@media (max-width: 767px) {
  .wrap { width: min(1120px, calc(100% - 24px)); }
  .header-row { gap: 8px; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--navy);
    border-radius: 8px;
    flex-shrink: 0;
  }
  .nav-toggle:hover { background: var(--slate-100); }
  .nav, .header-actions {
    display: none;
  }
  .nav-toggle { margin-left: auto; }
  .site-header.is-open .nav,
  .site-header.is-open .header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex-basis: 100%;
    gap: 4px;
  }
  .header-actions .signin.desktop-only { display: none; }
  .header-row {
    flex-wrap: wrap;
  }
  .site-header.is-open .nav a,
  .site-header.is-open .header-actions a {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
  }
  .site-header.is-open .header-actions .btn { width: 100%; }
  .nav-mobile-only { display: flex; }
  .hero-grid { gap: 24px; padding: 40px 0; }
  .cta-row { flex-direction: column; }
  .cta-row .btn { width: 100%; }
  .section { padding: 40px 0; }
  .page { padding: 40px 0; }
  .cta-band { padding: 28px 20px; }
  .cta-band .btn { width: 100%; }
  .auth-wrap { padding: 32px 16px; }
  .auth-card { padding: 24px 20px; }
  .live-row { gap: 8px; font-size: 13px; }
  .live-row span { min-width: 0; overflow-wrap: anywhere; }
  .app-top { padding: 8px 12px; gap: 8px; }
  .app-main { padding: 12px; }
  .pagehead { flex-direction: column; align-items: stretch; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .btn { flex: 1; }
  .filters { grid-template-columns: 1fr; }
  table { min-width: 640px; }
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .site-footer a { display: inline-flex; min-height: 44px; align-items: center; }
}

@media (max-width: 639px) {
  h2 { font-size: 1.25rem; }
  .stat { font-size: 24px; }
}
