:root {
  color-scheme: light;
  --ink: #17231e;
  --muted: #66756e;
  --line: #dfe8e3;
  --surface: #ffffff;
  --soft: #f3f7f5;
  --green: #0b8f55;
  --green-dark: #07683f;
  --green-soft: #e5f6ed;
  --orange: #f28b36;
  --danger: #a93838;
  --danger-soft: #fff0f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eef4f1; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 5vw;
  color: #fff;
  background: #102c21;
  box-shadow: 0 8px 24px rgba(16, 44, 33, .12);
}

.brand { font-weight: 800; letter-spacing: .03em; }
.divider { margin: 0 10px; color: #79a28f; }
.link-button { border: 0; padding: 8px; color: #dfeee7; background: transparent; }
.link-button:hover { color: #fff; }

.page-shell { width: min(1120px, 92vw); margin: 0 auto; padding: 54px 0 80px; }
.hero { max-width: 760px; margin-bottom: 32px; }
.hero h1 { margin: 5px 0 12px; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.03; letter-spacing: -.05em; }
.hero > p:last-child { color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.eyebrow { margin: 0; color: var(--green); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.route-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 14px; margin-bottom: 24px; }
.route-card { display: flex; gap: 16px; min-height: 154px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.route-card.destination { border-color: #bedfce; background: #f5fcf8; }
.route-index { flex: 0 0 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-weight: 800; }
.route-card small { color: var(--muted); }
.route-card h2 { margin: 5px 0; font-size: 1.45rem; }
.route-card p { margin: 0; color: #53635c; line-height: 1.45; }
.route-line { align-self: center; color: var(--orange); font-size: 1.5rem; font-weight: 900; }

.card { margin-top: 24px; padding: clamp(20px, 4vw, 36px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 18px 50px rgba(22, 58, 43, .07); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { margin: 4px 0 0; font-size: 1.65rem; letter-spacing: -.02em; }
.place-count, .success-badge { padding: 8px 12px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: .84rem; font-weight: 800; }

.package-list { display: grid; gap: 12px; }
.package-row { display: grid; grid-template-columns: 92px repeat(4, 1fr) 42px; gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.place-number { align-self: center; font-weight: 800; }
label { display: grid; gap: 7px; color: #53635c; font-size: .78rem; font-weight: 700; }
input { min-width: 0; width: 100%; height: 44px; padding: 0 12px; border: 1px solid #cbd8d1; border-radius: 10px; color: var(--ink); background: #fff; outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11, 143, 85, .12); }
.remove-place { width: 42px; height: 42px; border: 0; border-radius: 10px; color: #8b403b; background: #f8e8e7; font-size: 1.4rem; }
.remove-place:disabled { cursor: not-allowed; opacity: .35; }
.add-place { margin-top: 14px; padding: 10px 4px; border: 0; color: var(--green-dark); background: transparent; font-weight: 800; }
.add-place span { display: inline-grid; width: 26px; height: 26px; margin-right: 7px; place-items: center; border-radius: 50%; color: #fff; background: var(--green); }

.cargo-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0; padding: 18px; border-radius: 16px; background: #122d22; color: #fff; }
.cargo-summary div { display: grid; gap: 5px; }
.cargo-summary small { color: #9fc0b1; }
.primary { min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; color: #fff; background: var(--green); font-weight: 800; box-shadow: 0 10px 24px rgba(11, 143, 85, .2); }
.primary:hover { background: var(--green-dark); }
.primary:disabled { cursor: wait; opacity: .7; }
.calculate { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; font-size: 1rem; }
.safe-note, .footnote { margin: 12px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.alert { margin: 0 0 18px; padding: 13px 15px; border-radius: 12px; line-height: 1.4; }
.alert.error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f0c7c7; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; color: var(--muted); background: var(--soft); font-size: .75rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
td small { display: block; max-width: 440px; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.tariff-code { display: inline-block; min-width: 40px; padding: 5px 8px; border-radius: 8px; color: var(--green-dark); background: var(--green-soft); font-weight: 800; text-align: center; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #dff2e8 0, transparent 42%), #eef4f1; }
.login-card { width: min(430px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(16, 44, 33, .13); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 14px; color: #fff; background: var(--green); font-size: 1.5rem; font-weight: 900; }
.login-card h1 { margin: 6px 0 10px; font-size: 2rem; letter-spacing: -.04em; }
.muted { color: var(--muted); line-height: 1.5; }
.login-form { display: grid; gap: 18px; margin-top: 24px; }

@media (max-width: 820px) {
  .route-grid { grid-template-columns: 1fr; }
  .route-line { justify-self: center; transform: rotate(90deg); }
  .package-row { grid-template-columns: repeat(2, 1fr); }
  .place-number { grid-column: 1 / -1; }
  .remove-place { grid-column: 2; justify-self: end; }
  .cargo-summary { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .page-shell { width: min(94vw, 1120px); padding-top: 34px; }
  .topbar { padding: 0 4vw; font-size: .88rem; }
  .package-row { grid-template-columns: 1fr; }
  .remove-place { grid-column: 1; justify-self: end; }
  .section-heading { align-items: flex-start; }
  .login-card { padding: 28px 22px; }
}
