:root {
  --brand: #006db7;
  --brand-2: #006bd7;
  --brand-dark: #004e86;
  --cyan: #00a8d5;
  --ink: #111111;
  --ink-2: #212121;
  --navy: #0b1f33;
  --navy-2: #0d2a4a;
  --paper: #ffffff;
  --mist: #f6f6f6;
  --line: #e5e5e5;
  --muted: #777777;
  --ok: #27ae60;
  --warn: #d97706;
  --bad: #eb0028;
  --info: #006db7;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

html { height: auto; min-height: 100%; }
body {
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink-2);
  background: var(--paper);
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 4px;
  padding: 5px 10px;
  line-height: 0;
  text-decoration: none;
}
.brand-logo {
  height: 42px;
  width: auto;
  max-width: min(260px, 70vw);
  object-fit: contain;
  display: block;
}
.login-logo .brand-logo { height: 40px; max-width: 200px; }
.sidebar .brand { padding: 0.85rem; }
.sidebar-logo { width: 100%; justify-content: center; }
.sidebar-logo .brand-logo { height: 40px; max-width: 180px; }

.btn-amber,
.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 0.55rem 1.25rem;
}
.btn-amber:hover,
.btn-brand:hover,
.btn-amber:focus,
.btn-brand:focus {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
}

/* Public */
.public-shell {
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.top-slim {
  flex: 0 0 auto;
  background: #0a0a0a;
  color: #cfcfcf;
  font-size: 0.78rem;
  padding: 0.35rem 0;
}
.top-slim a { color: #cfcfcf; text-decoration: none; }
.top-slim a:hover { color: #fff; }

.public-nav {
  flex: 0 0 auto;
  background: #111;
  color: #fff;
  padding: 0.7rem 0;
  border-bottom: 3px solid var(--brand);
}
.public-nav a { color: #fff; text-decoration: none; }

.hero {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  isolation: isolate;
  color: #fff;
  padding: 5.6rem 0 5rem;
  background-color: #0b1f33;
  background-image:
    linear-gradient(105deg, rgba(8, 16, 28, 0.88) 0%, rgba(8, 16, 28, 0.62) 38%, rgba(0, 109, 183, 0.42) 68%, rgba(8, 16, 28, 0.55) 100%),
    url("/assets/hero-shipping.jpg");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(8, 16, 28, 0.35), transparent 55%),
    linear-gradient(to top, rgba(8, 16, 28, 0.28), transparent 40%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }

.hero-in {
  opacity: 0;
  transform: translate3d(-220px, 0, 0);
}
.hero.is-ready .hero-in {
  -webkit-animation: heroSlideIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation: heroSlideIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  -webkit-animation-delay: var(--in-delay, 0ms);
  animation-delay: var(--in-delay, 0ms);
}
@-webkit-keyframes heroSlideIn {
  from {
    opacity: 0;
    transform: translate3d(-220px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@keyframes heroSlideIn {
  from {
    opacity: 0;
    transform: translate3d(-220px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.hero .kicker {
  letter-spacing: 0.28em;
  font-size: 0.78rem;
  font-weight: 700;
  color: #9ad4f0;
  margin-bottom: 0.55rem;
}
.hero h1 {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.hero .lede { color: #d7e6f2; max-width: 36rem; }
.track-box {
  background: #fff;
  color: var(--ink);
  border-radius: 2px;
  padding: 0.45rem;
  box-shadow: var(--shadow);
  max-width: 640px;
}
.track-box input {
  border: 0;
  box-shadow: none;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.track-box input:focus { box-shadow: none; }

.public-main {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  padding: 4rem 0 4.5rem;
  background: #fff;
  margin-top: 0;
}
.how-wrap { max-width: 1000px; }

.how-it-works {
  padding: 0.5rem 0 1.5rem;
}
.how-title {
  font-size: 2rem;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.03em;
  margin: 0 0 2.2rem;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 1rem;
}
.how-step {
  text-align: center;
  padding: 0.5rem 0.75rem;
}
.how-icon {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.how-icon svg {
  width: 88px;
  height: 88px;
}
.how-step p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111;
  line-height: 1.35;
}
@media (max-width: 767px) {
  .how-grid { grid-template-columns: 1fr; gap: 2rem; }
  .how-title { text-align: center; font-size: 1.65rem; }
}
.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.result-head {
  padding: 1.4rem 1.5rem 1.1rem;
  border-bottom: 3px solid var(--brand);
  background: var(--mist);
}
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 2px;
  padding: 0.2rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mode-sea { background: #e6f3fb; color: var(--brand-dark); }
.mode-air { background: #d9f4fb; color: #066a86; }

.stepper {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 1.2rem 1.4rem 0.4rem;
}
.step {
  flex: 1 0 7rem;
  min-width: 7rem;
  text-align: center;
  position: relative;
  font-size: 0.75rem;
  color: var(--muted);
}
.step::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin: 0 auto 0.4rem;
  background: #d1d5db;
  border: 3px solid #e5e7eb;
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 6px;
  left: calc(50% + 12px);
  right: calc(-50% + 12px);
  height: 2px;
  background: #e5e7eb;
}
.step.done { color: var(--ok); font-weight: 600; }
.step.done::before { background: var(--ok); border-color: #bbf7d0; }
.step.done:not(:last-child)::after { background: #86efac; }
.step.current { color: var(--brand); font-weight: 700; }
.step.current::before { background: var(--brand); border-color: #9ad4f0; }
.step.bad,
.step.current.bad {
  color: var(--bad);
  font-weight: 700;
}
.step.bad::before,
.step.current.bad::before {
  background: var(--bad);
  border-color: #fecaca;
}
.step.bad:not(:last-child)::after,
.step.current.bad:not(:last-child)::after {
  background: #f8a5b0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem 1rem;
  padding: 1rem 1.5rem 1.3rem;
}
.meta-grid dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.meta-grid dd { margin: 0; font-weight: 600; color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0 1.5rem 1.5rem; }
.timeline li {
  position: relative;
  padding: 0 0 1rem 1.2rem;
  border-left: 2px solid #dbe7f0;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}
.timeline .when { font-size: 0.78rem; color: var(--muted); }

.idle-panel, .err-panel {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.faq-section {
  flex: 0 0 auto;
  background: #fff;
  padding: 3.2rem 0 4.2rem;
  border-top: 1px solid #ececec;
}
.faq-wrap { max-width: 920px; }
.faq-section .how-title {
  margin-bottom: 2.4rem;
  font-size: 2.05rem;
}
.faq-list { display: flex; flex-direction: column; }
.faq-item {
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e3e3e3;
}
.faq-item:first-child { border-top: 1px solid #e3e3e3; }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 1.15rem 0.15rem 1.15rem 0;
  font-weight: 700;
  color: #111;
  font-size: 1.02rem;
  line-height: 1.35;
}
.faq-q:hover,
.faq-q:focus-visible { color: #111; }
.faq-q:focus { outline: none; }
.faq-q:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.faq-chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.faq-chevron svg {
  width: 18px;
  height: 18px;
  display: block;
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease;
}
.faq-item.open .faq-a {
  grid-template-rows: 1fr;
  opacity: 1;
}
.faq-a-inner {
  overflow: hidden;
  min-height: 0;
}
.faq-a p {
  margin: 0;
  padding: 0 2.4rem 1.2rem 0;
  color: #333;
  line-height: 1.65;
}

.public-footer {
  flex: 0 0 auto;
  background: #111;
  color: #9a9a9a;
  font-size: 0.85rem;
  padding: 1.6rem 0;
  border-top: 3px solid var(--brand);
}
.public-footer strong { color: #fff; }
.staff-login-link {
  color: #8a8a8a;
  text-decoration: none;
  font-size: 0.8rem;
}
.staff-login-link:hover { color: #fff; }

.suggest-menu {
  position: fixed;
  z-index: 20000;
  display: none;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.suggest-menu.open { display: block; }
.suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 0.65rem 0.9rem;
  color: #212121;
  font-size: 0.92rem;
}
.suggest-item strong { color: var(--brand); font-weight: 800; }
.suggest-item:hover,
.suggest-item.is-active { background: #eef6fc; }
.suggest-empty {
  padding: 0.7rem 0.9rem;
  color: #777;
  font-size: 0.85rem;
}

/* Login — full-bleed shipping photo + floating card */
.login-body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 1.5rem;
  background: #1a1d22;
}
.login-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  filter: saturate(0.55) brightness(0.72);
}
.login-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(10, 12, 16, 0.28);
}
.login-stage {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-logo {
  margin-bottom: 1.15rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.login-heading {
  margin: 0 0 1.15rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.login-card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 1.7rem 1.55rem 1.45rem;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
  border: 0;
}
.login-alert {
  background: #ffe3e8;
  color: #9b0019;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}
.login-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.85rem 0.1rem;
  border-bottom: 1px solid #ececec;
}
.login-field + .login-field { margin-top: 0.15rem; }
.login-ico {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #9a9a9a;
  display: inline-flex;
}
.login-ico svg { width: 20px; height: 20px; display: block; }
.login-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  font-size: 0.95rem;
  color: #222;
}
.login-field input::placeholder { color: #b0b0b0; }
.login-field input:focus { box-shadow: none; outline: 0; }
.login-eye {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #9a9a9a;
  padding: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.login-eye svg { width: 20px; height: 20px; display: block; }
.login-eye:hover { color: var(--brand); }
.login-submit {
  display: block;
  width: 100%;
  margin-top: 1.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--brand-dark) 0%, var(--brand) 48%, var(--cyan) 100%);
  box-shadow: 0 10px 22px rgba(0, 109, 183, 0.38);
}
.login-submit:hover,
.login-submit:focus {
  color: #fff;
  background: linear-gradient(90deg, #003e6b 0%, var(--brand-2) 50%, #00b7e6 100%);
}
.login-submit:disabled { opacity: 0.75; }
.login-back {
  margin-top: 1.15rem;
  color: #e8e8e8;
  font-size: 0.82rem;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.login-back:hover { color: #fff; }

/* Dashboard — sidebar is always viewport-tall on every screen */
.dash-body {
  background: var(--mist);
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.dash-wrap {
  display: flex;
  align-items: stretch;
  min-height: 100%;
  height: 100%;
}
.sidebar {
  width: 240px;
  background: #111;
  color: #d0d0d0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 100%;
  height: 100%;
}
.sidebar .brand {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.side-nav { padding: 0.8rem 0.7rem; display: flex; flex-direction: column; gap: 0.25rem; }
.side-nav button {
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 2px;
  padding: 0.65rem 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.side-nav button:hover,
.side-nav button.active {
  background: rgba(0, 109, 183, 0.22);
  color: #fff;
}
.side-nav button.active { box-shadow: inset 3px 0 0 var(--brand); }
.side-foot { margin-top: auto; padding: 1rem; font-size: 0.75rem; color: #888; }
.side-mask {
  display: none;
}
.dash-search { max-width: 280px; }
.actions-cell {
  white-space: nowrap;
}
.actions-cell .btn,
.actions-cell a.btn {
  margin: 0 0.25rem 0.15rem 0;
}
.row-inactive { opacity: 0.62; }
.you-pill {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 2px;
  background: var(--brand);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
}
.report-card {
  background: #f6f6f6;
  border-left: 3px solid var(--brand);
  padding: 0.75rem 0.85rem;
}
.report-card-k {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.report-card-v {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 0.2rem;
}
.pub-yes {
  color: var(--ok);
  font-weight: 700;
}
.pub-no {
  color: var(--muted);
  font-weight: 700;
}

.dash-main {
  flex: 1;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.topbar strong { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; }
.role-pill {
  border-radius: 2px;
  padding: 0.15rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.role-admin { background: var(--brand); color: #fff; }
.role-coord { background: #e6f3fb; color: var(--brand-dark); }

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.1rem 2rem;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}
.panel-h {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.panel-h h2 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: var(--ink);
}

.table-scroll { overflow: auto; max-height: calc(100vh - 230px); }
.ops-table {
  font-size: 0.78rem;
  margin: 0;
  white-space: nowrap;
}
.ops-table thead th {
  position: sticky;
  top: 0;
  background: #111;
  color: #fff;
  font-weight: 600;
  z-index: 2;
  border-color: #2a2a2a;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}
.ops-table tbody td { vertical-align: middle; }
.ops-table .sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
.ops-table thead .sticky-col { background: #111; z-index: 3; }

.badge-st {
  display: inline-block;
  border-radius: 2px;
  padding: 0.12rem 0.5rem;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.st-not_received { background: #eeeeee; color: #444; }
.st-received { background: #e6f3fb; color: var(--brand-dark); }
.st-loaded { background: #d9f4fb; color: #066a86; }
.st-detained { background: #ffe3e8; color: #9b0019; }
.st-released { background: #dceeff; color: #0b4a7a; }
.st-delivered { background: #d9f5e5; color: #146c38; }
.st-cancelled { background: #f3f3f3; color: #777; text-decoration: line-through; }

.pay-unpaid { color: var(--muted); }
.pay-pending { color: var(--warn); font-weight: 700; }
.pay-half_paid { color: var(--brand); font-weight: 700; }
.pay-paid { color: var(--ok); font-weight: 700; }

.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast-item {
  background: #111;
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 2px;
  min-width: 240px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--brand);
}
.toast-item.ok { background: var(--ok); border-left-color: #fff; }
.toast-item.err { background: var(--bad); border-left-color: #fff; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .sidebar.open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    height: 100vh;
    height: 100dvh;
    z-index: 1040;
  }
  .side-mask.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
  }
  .dash-search { max-width: 100%; }
  .hero { padding: 2.6rem 0 2.2rem; }
}
