:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #5f6e7e;
  --faint: #8a98aa;
  --line: #dce6ed;
  --line-strong: #b9c8d4;
  --paper: #ffffff;
  --soft: #f6fafc;
  --soft-blue: #e8f7fe;
  --brand: #00a0e0;
  --brand-strong: #007eb5;
  --brand-soft: #dff5fd;
  --navy: #06304a;
  --navy-2: #074468;
  --accent: #009038;
  --accent-strong: #007530;
  --accent-soft: #e2f7e9;
  --brand-red: #d81717;
  --warning: #b26a12;
  --warning-soft: #fff4df;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --shadow: 0 16px 40px rgba(0, 80, 125, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 32px auto 64px;
}

.staff-shell {
  background: #edf6f9;
}

.app-layout {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  color: #d9eef7;
  background:
    linear-gradient(180deg, rgba(0, 160, 224, 0.15), rgba(0, 144, 56, 0.09)),
    var(--navy);
  border-right: 4px solid var(--brand-red);
}

.workspace {
  min-width: 0;
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 14px 32px;
  background: rgba(246, 250, 252, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.workspace-topbar strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.workspace-main {
  width: min(1240px, calc(100% - 48px));
  margin: 28px auto 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 3px solid var(--brand-red);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 850;
}

.brand:hover {
  text-decoration: none;
}

.sidebar .brand {
  color: #ffffff;
}

.brand-logo {
  display: block;
  width: 142px;
  height: auto;
}

.sidebar .brand-logo {
  width: 150px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
}

.nav,
.side-nav,
.actions,
.language-switch {
  display: flex;
  align-items: center;
}

.nav {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav > a,
.side-nav a {
  font-weight: 750;
}

.nav > a {
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 8px;
}

.nav > a:hover {
  color: var(--ink);
  background: var(--brand-soft);
  text-decoration: none;
}

.side-nav {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.side-nav a {
  color: #c9d7e8;
  padding: 11px 12px;
  border-radius: 8px;
}

.side-nav a:hover {
  color: #ffffff;
  background: var(--navy-2);
  text-decoration: none;
}

.side-nav a:first-child {
  color: #ffffff;
  background: rgba(0, 160, 224, 0.18);
  box-shadow: inset 4px 0 0 var(--accent);
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.inline-form {
  display: inline;
}

.language-switch {
  gap: 6px;
}

.language-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.sidebar .language-switch a {
  color: #dbe7f4;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}

.language-switch a.active {
  color: #ffffff;
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.messages {
  width: min(1240px, calc(100% - 48px));
  margin: 20px auto 0;
}

.public-shell .messages {
  width: min(1180px, calc(100% - 40px));
}

.message {
  padding: 12px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(16, 32, 51, 0.06);
}

.message.success {
  color: var(--accent);
  background: var(--accent-soft);
}

.message.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.hero,
.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.85fr);
  gap: 40px;
  align-items: start;
  min-height: 0;
  padding: 34px 0 48px;
}

.public-hero {
  align-items: stretch;
  min-height: 0;
}

.hero > *,
.public-hero > * {
  min-width: 0;
}

.hero h1,
.public-hero h1,
.page-head h1,
.narrow h1,
.tracking-summary h1 {
  margin: 0 0 16px;
  font-size: 3rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.page-head h1,
.narrow h1,
.tracking-summary h1 {
  font-size: 2.2rem;
}

.hero-copy,
.hero-copy-block .hero-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.65;
}

.eyebrow,
.metric span,
.summary-card span,
dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #96a9bd;
}

.hero-panel,
.route-preview {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 0;
  padding: 14px 18px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(0, 160, 224, 0.18), rgba(0, 144, 56, 0.14)),
    var(--navy);
}

.brand-showcase {
  display: grid;
  gap: 16px;
}

.visual-tile {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background-color: #ffffff;
  background-image: var(--visual-pack);
  background-repeat: no-repeat;
  background-size: 200% 200%;
}

.visual-hero {
  min-height: 260px;
  background-position: 0 0;
}

.visual-dashboard {
  background-position: 100% 0;
}

.visual-courier {
  background-position: 0 100%;
}

.visual-map {
  background-position: 100% 100%;
}

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

.brand-visual-grid .visual-tile {
  min-height: 120px;
}

.metric {
  padding: 20px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 0;
}

.hero-panel .metric {
  padding: 18px 16px;
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: #9fb3c9;
}

.metric strong,
.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
}

.hero-panel .metric strong {
  font-size: 0.98rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.lookup-card,
.tracking-card,
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lookup-card {
  max-width: 600px;
  margin-top: 28px;
}

.tracking-card {
  width: min(600px, 100%);
  max-width: 100%;
  margin-top: 30px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tracking-card p {
  flex: 1 1 auto;
  margin: 0;
}

.tracking-card label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.route-preview {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 24px;
  color: #ffffff;
  background: var(--navy);
}

.route-preview-map {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.route-preview-steps {
  display: grid;
  gap: 14px;
}

.route-preview-steps div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.route-preview-steps div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.route-preview-steps span {
  grid-row: span 2;
  color: #7dd3fc;
  font-weight: 900;
}

.route-preview-steps strong {
  color: #ffffff;
}

.route-preview-steps p {
  margin: 0;
  color: #c9d7e8;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(18, 107, 166, 0.16);
  border-color: var(--brand);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--brand-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: #006995;
  text-decoration: none;
}

.button.primary {
  background: var(--brand-strong);
}

.button.secondary {
  color: var(--ink);
  background: #e5edf5;
}

.button.secondary:hover {
  background: #d8e4ef;
}

.sidebar .button.secondary {
  width: 100%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

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

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

.summary-card,
.panel,
.form-card,
.tracking-summary,
.timeline,
.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16, 32, 51, 0.06);
}

.summary-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

.summary-card.warning::before {
  background: var(--warning);
}

.summary-card.warning strong,
.row-warning td:first-child a {
  color: var(--warning);
}

.toolbar {
  margin-bottom: 18px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 32, 51, 0.05);
}

.toolbar input {
  flex: 1 1 420px;
}

.toolbar select {
  flex: 0 1 220px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  background: #f3f7fb;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f8fbfe;
}

td span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 850;
}

.status-pill.compact {
  min-height: 28px;
  font-size: 0.85rem;
}

.narrow {
  width: min(720px, 100%);
  margin: 0 auto;
}

.form-card,
.panel {
  padding: 22px;
}

.form-card p,
.stacked p {
  margin: 0 0 16px;
}

.form-card label,
.stacked label,
.form-grid label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-weight: 800;
}

.form-card .helptext,
.stacked .helptext {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 0.9rem;
}

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

.detail-layout,
.tracking-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.detail-layout + .detail-layout,
.panel + .detail-layout,
.detail-layout + .panel,
.table-wrap + .detail-layout {
  margin-top: 20px;
}

.tracking-shell {
  align-items: stretch;
}

.tracking-summary {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  min-height: 320px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(0, 160, 224, 0.18), rgba(0, 144, 56, 0.12)),
    var(--navy);
  border-top: 4px solid var(--brand-red);
}

.tracking-summary .eyebrow,
.tracking-summary dt {
  color: #9fb3c9;
}

.tracking-summary .status-pill {
  color: #0f5135;
  background: #d9f7e8;
}

.tracking-summary dd {
  color: #ffffff;
}

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

dt,
dd {
  margin: 0;
}

dd {
  margin-top: 5px;
  line-height: 1.45;
}

.timeline {
  padding: 22px;
}

.timeline h2,
.panel h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  padding-bottom: 18px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-item time {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.timeline-item p {
  margin: 8px 0 0;
}

.dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--soft-blue);
}

.danger-zone {
  margin-top: 20px;
}

.danger {
  background: var(--danger);
}

.danger:hover {
  background: #8f1d14;
}

.object-list {
  margin: 0;
  padding-left: 20px;
}

.object-list li {
  margin-bottom: 11px;
  line-height: 1.5;
}

.rich-list > li {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.form-grid p {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.form-grid label {
  margin-bottom: 0;
}

.inline-note {
  display: inline-flex;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.public-files,
.address-helpers {
  margin-top: 20px;
}

.route-map {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 8px;
  background: #e8eef5;
}

@media (max-width: 1040px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 16px;
  }

  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .side-nav a {
    white-space: nowrap;
  }

  .sidebar-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .workspace-topbar {
    position: relative;
  }
}

@media (max-width: 820px) {
  main,
  .workspace-main,
  .messages,
  .public-shell .messages {
    width: min(100% - 28px, 760px);
  }

  .hero,
  .public-hero,
  .detail-layout,
  .tracking-shell,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .public-hero {
    min-height: 0;
    gap: 24px;
    padding: 20px 0;
  }

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

  .hero-panel .metric {
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .hero-panel .metric:last-child {
    border-bottom: 0;
  }

  .hero h1,
  .public-hero h1 {
    font-size: 2.35rem;
  }

  .page-head h1,
  .narrow h1,
  .tracking-summary h1 {
    font-size: 1.9rem;
  }

  .topbar,
  .page-head,
  .workspace-topbar,
  .toolbar,
  .lookup-card,
  .tracking-card {
    align-items: stretch;
    flex-direction: column;
  }

  .lookup-card,
  .tracking-card,
  .route-preview {
    width: 100%;
    max-width: 100%;
  }

  .nav {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .tracking-card p {
    width: 100%;
  }

  .lookup-card button,
  .tracking-card button {
    width: 100%;
  }

  .details-grid,
  .form-grid p {
    grid-template-columns: 1fr;
  }

  .form-grid label {
    margin-bottom: 7px;
  }

  th,
  td {
    padding: 12px;
  }
}
