:root {
  --brand:        #9b1c1f;
  --brand-dark:   #7f1417;
  --brand-light:  #b8474a;
  --amber:        #e9a63b;
  --green:        #2e7d4f;
  --cream:        #fbf6ec;
  --card:         #ffffff;
  --ink:          #17161a;
  --ink-soft:     #55535c;
  --muted:        #8b8891;
  --line:         #ebe5d8;
  --radius:       18px;
  --shadow:       0 1px 2px rgba(23, 22, 26, 0.04), 0 8px 24px rgba(23, 22, 26, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;

  /* Full-height column so short pages still push the footer to the bottom.
     dvh keeps it honest on mobile, where the browser chrome moves. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }

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

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- header */

.header {
  background: linear-gradient(180deg, #a32226 0%, #8e171b 100%);
  color: #fff;
}

.header__inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand__mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fdfaf3;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.brand__name {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.brand__tagline {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 3px;
}

.header__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
  font-weight: 600;
}

.header__nav a { text-decoration: none; opacity: 0.95; }
.header__nav a:hover { opacity: 1; text-decoration: underline; }

/* ------------------------------------------------------------------ page */

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(23, 22, 26, 0.07);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 32px;
}

.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.value { font-size: 17px; font-weight: 700; margin-top: 4px; }

/* --------------------------------------------------------- consignment */

.consignment__top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.consignment__no {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.pill {
  flex: none;
  margin-left: auto;
  background: var(--green);
  color: #fff;
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.pill--transit  { background: #b26a10; }
.pill--hold     { background: #8b3a3a; }
.pill--received { background: #4a5568; }

.route {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  margin-top: 14px;
}

.route__arrow { color: var(--amber); font-size: 24px; line-height: 1; }

.grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 40px;
}

.grid__full { grid-column: 1 / -1; }

.contents { font-size: 17px; font-weight: 700; margin-top: 4px; max-width: 60ch; }

/* ------------------------------------------------------------- timeline */

.section-title { font-size: 22px; font-weight: 800; }

.timeline { list-style: none; padding: 0; margin: 22px 0 0; }

.timeline__item {
  position: relative;
  padding: 0 0 30px 34px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: -4px;
  width: 2px;
  background: var(--line);
}

.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::before { display: none; }

.timeline__dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  background: var(--cream);
}

.timeline__item--current .timeline__dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(155, 28, 31, 0.1);
}

.timeline__time { font-size: 13.5px; color: var(--muted); }
.timeline__status { font-size: 17px; font-weight: 700; margin-top: 3px; }

.timeline__where {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 5px;
}

.timeline__note { font-size: 15px; color: var(--muted); margin-top: 3px; }

/* ----------------------------------------------------------------- home */

.hero { text-align: center; padding: 46px 32px 40px; }

.hero__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero__title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 12px;
  line-height: 1.15;
}

.hero__sub {
  font-size: 17px;
  color: var(--ink-soft);
  margin-top: 12px;
  max-width: 46ch;
  margin-inline: auto;
}

.track-form {
  display: flex;
  gap: 12px;
  margin: 28px auto 0;
  max-width: 520px;
}

.track-form input {
  flex: 1;
  min-width: 0;
  padding: 15px 18px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.track-form input::placeholder { font-weight: 500; color: #b3aea3; letter-spacing: 0; }
.track-form input:focus { border-color: var(--brand-light); }

.btn {
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 28px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn:hover { background: var(--brand-dark); }
.btn--ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.btn--ghost:hover { background: #fff; border-color: var(--brand-light); }
.btn--small { padding: 9px 16px; font-size: 14px; border-radius: 10px; }
.btn--danger { background: #8b3a3a; }

.hint { font-size: 14px; color: var(--muted); margin-top: 16px; }
.hint code {
  background: #f3ede1;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature { padding: 26px 24px; }
.feature h3 { font-size: 17px; font-weight: 800; margin-top: 14px; }
.feature p { font-size: 15px; color: var(--ink-soft); margin-top: 6px; }

.feature__icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #fdf1ef;
  display: grid;
  place-items: center;
  color: var(--brand);
}

/* --------------------------------------------------------------- states */

.notice {
  background: #fdf1ef;
  border: 1px solid #f2d4d1;
  color: #7f1417;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
}

.empty { text-align: center; padding: 52px 32px; }
.empty h2 { font-size: 24px; font-weight: 800; }
.empty p { color: var(--ink-soft); margin-top: 10px; }

/* ---------------------------------------------------------------- admin */

.admin-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-head .section-title { margin-right: auto; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field > span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  width: 100%;
}

.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-light); }

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

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

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 10px 0;
  font-weight: 700;
}
.table td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); }
.table td:last-child, .table th:last-child { text-align: right; padding-right: 0; }
.table a { font-weight: 700; text-decoration: none; color: var(--brand); }
.table a:hover { text-decoration: underline; }

.tag {
  display: inline-block;
  background: #f3ede1;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- footer */

.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 26px 24px 40px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.footer a { color: var(--brand); text-decoration: none; font-weight: 600; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 720px) {
  .header__inner { padding: 14px 18px; }
  .brand__mark { width: 44px; height: 44px; border-radius: 12px; }
  .brand__name { font-size: 21px; }
  .brand__tagline { font-size: 10.5px; letter-spacing: 0.18em; }
  .page { padding: 18px 16px 48px; gap: 18px; }
  .card { padding: 22px 20px; border-radius: 15px; }
  .consignment__top { flex-direction: column; gap: 12px; }
  .pill { margin-left: 0; align-self: flex-start; }
  .consignment__no { font-size: 27px; }
  .route { font-size: 18px; gap: 9px; }
  .grid, .form-grid, .features { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hero { padding: 34px 20px 30px; }
  .hero__title { font-size: 29px; }
  .track-form { flex-direction: column; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}

@media print {
  .header__nav, .track-form, .btn { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* ------------------------------------------------------- full-bleed hero */

.hero-full {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 0 auto;
  min-height: 420px;
  padding: 56px 24px 64px;
  text-align: center;
  background: #241318 url("/hero.svg?v=3") center / cover no-repeat;
  isolation: isolate;
}

.hero-full::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      62% 58% at 50% 54%,
      rgba(12, 6, 10, 0.55) 0%,
      rgba(12, 6, 10, 0) 72%
    ),
    linear-gradient(
      180deg,
      rgba(14, 8, 12, 0.5) 0%,
      rgba(14, 8, 12, 0.14) 42%,
      rgba(14, 8, 12, 0.5) 100%
    );
}

.hero-full__inner { width: 100%; max-width: 620px; }

.hero-full__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.hero-full__title {
  color: #fff;
  font-size: clamp(30px, 5.2vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-top: 14px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

.hero-full__sub {
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  margin-top: 14px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.track-form--hero { margin-top: 30px; max-width: 560px; }

.track-form--hero input {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  padding: 17px 20px;
}

.track-form--hero .btn {
  background: var(--amber);
  color: #2b1a1e;
  padding: 17px 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.track-form--hero .btn:hover { background: #f2b757; }

.hero-full .hint { color: rgba(255, 255, 255, 0.72); margin-top: 18px; }

.hero-full .hint code {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

@media (max-width: 720px) {
  .hero-full { min-height: 340px; padding: 42px 18px 52px; }
  .track-form--hero { flex-direction: column; }
}

/* ------------------------------------------------- admin form sectioning */

.fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.fieldset + .fieldset { margin-top: 26px; }

.fieldset > legend {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 0 0 12px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}

.checkline input { width: 18px; height: 18px; accent-color: var(--brand); }
