/* Self-hosted (Google Fonts is unreachable or slow in mainland China). Latin only; Chinese uses system fonts. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-wght.woff2?v=5.3.0") format("woff2-variations"),
       url("../fonts/manrope-latin-wght.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.password-control { position: relative; display: flex; width: 100%; }
.password-control input { width: 100%; padding-right: 58px !important; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--sky-600); cursor: pointer; padding: 6px; font: inherit; }
.modal-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; resize: vertical; }
.status-void { color: var(--muted); background: var(--surface-soft); }

:root {
  --navy-900: #0a2231;
  --navy-800: #102f40;
  --navy-700: #1b3e51;
  --navy-600: #2a5266;
  --sky-600: #2f6f8f;
  --sky-100: #e3eef4;
  --sky-50: #f1f7fa;
  --red-600: #c1272d;
  --red-700: #a51f24;
  --red-50: #fdf1f1;
  --text: #15222e;
  --text-soft: #3d5261;
  --muted: #687b8a;
  --faint: #a9b7c1;
  --line: #e1e8ed;
  --line-soft: #edf2f5;
  --bg: #f2f5f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --green-600: #1c7c4a;
  --green-50: #e9f6ef;
  --amber-700: #9a5b00;
  --amber-50: #fff4e2;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 47, 64, 0.06);
  --shadow: 0 10px 30px rgba(16, 47, 64, 0.08);
  --shadow-lg: 0 24px 64px rgba(8, 36, 51, 0.16);
  --ring: 0 0 0 4px rgba(47, 111, 143, 0.16);
  --font-display: "Manrope", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Manrope", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(47, 111, 143, 0.1), transparent 64%),
    radial-gradient(700px 360px at 0% 0%, rgba(193, 39, 45, 0.05), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
select { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

svg {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.hidden { display: none !important; }

.wrap {
  width: calc(100% - 40px);
  max-width: 1240px;
  margin: 0 auto;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(225, 232, 237, 0.9);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

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

.brand-logo {
  display: block;
  width: auto;
  height: 42px;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.brand-name {
  overflow: hidden;
  color: var(--navy-700);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand-en {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-right > * + * { margin-left: 14px; }

.today {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.today::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.today:empty { display: none; }

.client-auth {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-auth > * + * { margin-left: 8px; }

.btn-client-login {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--navy-700);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(27, 62, 81, 0.18);
  transition: background 0.18s ease, transform 0.18s var(--ease);
}

.btn-client-login svg { margin-right: 7px; font-size: 15px; }
.btn-client-login:hover { background: var(--navy-600); transform: translateY(-1px); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 300px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.user-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-600), var(--red-700));
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.user-meta strong {
  overflow: hidden;
  color: var(--navy-700);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--navy-700);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link svg { font-size: 16px; }
.nav-link:hover { background: var(--sky-50); color: var(--sky-600); }

.nav-link-pill {
  border: 1px solid var(--sky-100);
  background: var(--sky-50);
  color: var(--sky-600);
}

.nav-link-pill:hover { background: var(--sky-100); }

.btn-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn-icon:hover { border-color: #f1c9cb; background: var(--red-50); color: var(--red-600); }

/* ---------- Page & hero ---------- */

.page {
  position: relative;
  padding: 22px 0 40px;
  animation: rise 0.55s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 340px;
  padding: 52px 56px 112px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--navy-800) url("../assets/header-plane.jpg") center 46% / cover no-repeat;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 29, 43, 0.94) 0%, rgba(9, 45, 66, 0.76) 42%, rgba(9, 45, 66, 0.12) 78%),
    linear-gradient(0deg, rgba(4, 27, 42, 0.42), transparent 60%);
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: inherit;
  pointer-events: none;
}

.hero-content { max-width: 620px; color: #fff; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--red-600);
}

.hero-title {
  margin: 14px 0 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 46px;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.hero-text {
  max-width: 540px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1.8;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-meta svg { color: #ff8c90; font-size: 14px; }

.hero-compact {
  min-height: 250px;
  padding-top: 44px;
  padding-bottom: 96px;
  background-position: center 40%;
}

/* ---------- Search ---------- */

.search-card,
.result-card {
  position: relative;
  border: 1px solid rgba(225, 232, 237, 0.9);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-card {
  z-index: 3;
  margin: -72px 28px 0;
  padding: 22px 24px 24px;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
}

.search-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.card-kicker {
  display: block;
  color: var(--red-600);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.search-card-head h2 {
  margin: 3px 0 0;
  color: var(--navy-700);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

.search-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.search-form-pod {
  grid-template-columns: minmax(220px, 360px) auto;
  justify-content: start;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > span:first-child {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.select-wrap {
  position: relative;
  display: block;
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--faint);
  font-size: 18px;
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 0.18s ease;
}

.select-wrap:focus-within .field-icon { color: var(--sky-600); }

.search-form select,
.search-form input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 38px 0 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.search-form select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23687b8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

.search-form input[type="text"] {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-form select:hover,
.search-form input[type="text"]:hover { border-color: #c7d4dc; }

.search-form select:focus,
.search-form input[type="text"]:focus {
  outline: none;
  border-color: var(--sky-600);
  background-color: #fff;
  box-shadow: var(--ring);
}

.btn-swap {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--sky-600);
  font-size: 17px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.32s var(--ease), border-color 0.18s ease, background 0.18s ease;
}

.btn-swap:hover { border-color: #bcd3df; background: var(--sky-50); transform: rotate(180deg); }

.btn-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 140px;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #d0343a, var(--red-700));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(193, 39, 45, 0.24);
  transition: transform 0.18s var(--ease), box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-search svg { font-size: 17px; }

.btn-search:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(193, 39, 45, 0.28);
}

/* ---------- Result card ---------- */

.result-card {
  margin-top: 24px;
  overflow: hidden;
}

.result-card-raised {
  z-index: 3;
  margin: -64px 28px 0;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.result-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-head h2 {
  position: relative;
  margin: 0;
  padding-left: 14px;
  color: var(--navy-700);
  font-size: 18px;
  font-weight: 700;
}

.result-head h2::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: var(--red-600);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--sky-50);
  color: var(--sky-600);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.count-badge:empty { display: none; }

.result-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Rate table ---------- */

.rate-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.rate-table thead th {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.rate-table thead .th-left { text-align: left; }

.rate-table thead .th-group {
  padding: 9px 12px 7px;
  border-bottom: 0;
  background: var(--sky-50);
  color: var(--sky-600);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.rate-table .th-tiers th {
  padding-top: 5px;
  background: var(--sky-50);
  color: var(--navy-700);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
}

.rate-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  vertical-align: middle;
  transition: background 0.15s ease;
}

.rate-table tbody tr:last-child td { border-bottom: 0; }
.rate-table tbody tr:hover td { background: #f8fbfc; }
.rate-table tbody tr:hover td.price { background: #eef5f9; }

.cell-route,
.cell-airline,
.cell-no { text-align: left !important; }

.route {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Rates grouped by route: one header row per POL → POD, then its quotes. */
.rate-table tbody .group-row td,
.rate-table tbody .group-row:hover td {
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.rate-table tbody .group-row:not(:first-child) td { border-top: 1px solid var(--line); }

.group-head {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 22px;
}

.group-head > * + * { margin-left: 12px; }

.gh-pol {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.gh-pod {
  color: var(--navy-700);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.gh-city {
  color: var(--navy-700);
  font-size: 14px;
  font-weight: 700;
}

/* 中转地 between origin and destination in the route header. */
.gh-via {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #d6e3ea;
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy-700);
  font-size: 13px;
  white-space: nowrap;
}
.gh-via em {
  margin-right: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}
.gh-via b {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.gh-via-name {
  margin-left: 5px;
  font-weight: 600;
}

.gh-count {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.group-head .route-line svg,
.rate-table tbody tr:hover .group-head .route-line svg { background: var(--surface-soft); }

.rate-table thead .th-first,
.rate-table tbody .rate-row td:first-child { padding-left: 22px; }

.cell-transit,
.cell-cargo { text-align: left !important; }

.cell-transit { min-width: 104px; white-space: nowrap; }
.cell-cargo { min-width: 150px; }

.transit,
.cargo {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.transit > * + *,
.cargo > * + * { margin-left: 6px; }

.transit-time {
  color: var(--text-soft);
  font-size: 13px;
  white-space: nowrap;
}

.pack-text {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.cell-none { color: #b7c3cc; }

.attr-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.attr-chip.chip-direct { background: #e8f1f6; color: #245a75; }
.attr-chip.chip-transit { background: #fff1dc; color: #8a5200; }
.attr-chip.chip-intermodal { background: #e9f6ef; color: #1c6e43; }
.attr-chip.chip-spa { background: #f3eef8; color: #6b3fa0; }

.attr-chip.chip-density {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

/* Two equal halves: an inline grid sizes both 1fr tracks to the wider label. */
.heavy-chip {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  box-sizing: border-box;
  height: 22px;
  overflow: hidden;
  border: 1px solid #f1c7c9;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.heavy-chip b,
.heavy-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.heavy-chip b { background: var(--red-600); color: #fff; font-weight: 700; }

.heavy-chip span {
  background: var(--red-50);
  color: var(--red-700);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.port {
  display: flex;
  flex-direction: column;
  min-width: 44px;
  line-height: 1.25;
}

.port b {
  color: var(--navy-700);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.port small {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.route-line {
  position: relative;
  display: grid;
  width: 38px;
  height: 18px;
  place-items: center;
  color: var(--red-600);
  font-size: 13px;
}

.route-line::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1.5px dashed #c9d5dd;
}

.route-line svg {
  position: relative;
  padding: 3px;
  border-radius: 50%;
  background: inherit;
  box-sizing: content-box;
  transform: rotate(45deg);
}

.rate-table tbody td .route-line svg { background: var(--surface); }
.rate-table tbody tr:hover .route-line svg { background: #f8fbfc; }

.airline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.airline-badge {
  display: inline-grid;
  min-width: 32px;
  height: 24px;
  padding: 0 6px;
  place-items: center;
  border-radius: 6px;
  background: var(--navy-700);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.airline-name {
  color: var(--text-soft);
  font-size: 12.5px;
}

.cell-meta { white-space: nowrap; color: var(--text-soft); }

.rate-table td.price {
  background: #fbfdfe;
  color: var(--navy-700);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rate-table td.price.is-empty {
  color: #c3ced6;
  font-weight: 500;
}

.rate-table td.price-first { border-left: 1px solid var(--line-soft); }
.rate-table td.price-last { border-right: 1px solid var(--line-soft); }

.rate-table tbody td.remark {
  min-width: 140px;
  max-width: 220px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.rate-table .col-action {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 104px;
  box-shadow: -1px 0 0 var(--line-soft);
}

.rate-table thead .col-action { background: var(--surface-soft); }

.btn-book {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--sky-600), #245a75);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(47, 111, 143, 0.2);
  transition: transform 0.18s var(--ease), filter 0.18s ease, background 0.18s ease;
}

.btn-book svg { font-size: 14px; transition: transform 0.18s var(--ease); }
.btn-book:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-book:hover svg { transform: translateX(2px); }

.btn-book.is-guest {
  border-color: var(--line);
  background: var(--surface);
  color: var(--navy-700);
  box-shadow: none;
}

.btn-book.is-guest:hover {
  border-color: #bcd3df;
  background: var(--sky-50);
  color: var(--sky-600);
  filter: none;
}

/* ---------- Empty / loading states ---------- */

.state-row td,
.rate-table tbody .state-row:hover td { background: var(--surface); }

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 52px 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  place-items: center;
  border-radius: 50%;
  background: var(--sky-50);
  color: var(--sky-600);
  font-size: 24px;
}

.state-error .state-icon { background: var(--red-50); color: var(--red-600); }

.state strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.state p { margin: 0; }

.state .btn-ghost { margin-top: 8px; }

.spinner {
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
  border: 3px solid var(--sky-100);
  border-top-color: var(--sky-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 4px 0;
  border-top: 1px solid rgba(27, 62, 81, 0.09);
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Buttons ---------- */

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s var(--ease);
}

.btn-primary {
  border: 0;
  background: linear-gradient(135deg, #d0343a, var(--red-700));
  color: #fff;
  box-shadow: 0 8px 18px rgba(193, 39, 45, 0.22);
}

.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--navy-700);
}

.btn-ghost:hover:not(:disabled) { border-color: #c7d4dc; background: var(--surface-soft); }

.btn-sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
}

.btn-sm svg { font-size: 14px; }

.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 26, 38, 0.56);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade 0.2s ease both;
}

.modal-card {
  width: 440px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(5, 28, 42, 0.32);
  animation: pop 0.28s var(--ease) both;
}

.modal-card-wide { width: 680px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex;
  align-items: flex-start;
  padding: 22px 22px 0;
}

.modal-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  margin-right: 14px;
  place-items: center;
  border-radius: 12px;
  background: var(--red-50);
  color: var(--red-600);
  font-size: 20px;
}

.modal-title { flex: 1; min-width: 0; margin-right: 12px; }

.modal-title h3 {
  margin: 0;
  color: var(--navy-700);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.modal-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.modal-close:hover { background: var(--red-50); color: var(--red-600); }

.modal-form {
  display: block;
  padding: 20px 22px 22px;
}

.modal-form > * + * { margin-top: 16px; }

.modal-form label {
  display: block;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
}

.modal-form label > span:first-child {
  display: block;
  margin-bottom: 7px;
}

.modal-form label em {
  color: var(--red-600);
  font-style: normal;
}

.modal-form input[type="text"],
.modal-form input[type="password"],
.modal-form input[type="number"],
.modal-form select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.modal-form input::placeholder { color: var(--faint); font-weight: 400; }

.modal-form input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed #c9d6de;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.modal-form input[type="file"]:hover { border-color: var(--sky-600); background: var(--sky-50); }

.modal-form input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--navy-700);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.modal-form input[type="file"]::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--navy-700);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.modal-form input:focus {
  outline: none;
  border-color: var(--sky-600);
  background-color: #fff;
  box-shadow: var(--ring);
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

/* Live estimate under the weight in the booking dialog (mirrors the server's FreightQuote). */
.booking-estimate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--sky-50);
  color: var(--text-soft);
  font-size: 12.5px;
}
.booking-estimate > * { margin-right: 10px; }
.booking-estimate .be-label { font-weight: 700; }
.booking-estimate .be-amount {
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}
.booking-estimate .be-note { color: #8a5200; font-weight: 600; }

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

.booking-route {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background:
    radial-gradient(260px 120px at 100% 0%, rgba(255, 255, 255, 0.14), transparent 70%),
    linear-gradient(135deg, var(--navy-800), var(--sky-600));
  color: #fff;
}

.br-port {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.br-port small,
.br-airline small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 600;
}

.br-port b {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.br-port span,
.br-airline span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.br-line {
  position: relative;
  display: grid;
  flex: 1;
  min-width: 40px;
  height: 20px;
  place-items: center;
  color: #ff9ea1;
  font-size: 16px;
}

.br-line::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1.5px dashed rgba(255, 255, 255, 0.4);
}

.br-line svg {
  position: relative;
  padding: 0 6px;
  transform: rotate(45deg);
  box-sizing: content-box;
  background: transparent;
  filter: drop-shadow(0 0 6px rgba(16, 47, 64, 0.8));
}

.br-airline {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  line-height: 1.25;
}

.br-airline b {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.piece-section {
  display: block;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-soft);
}

.piece-table-wrap { margin-top: 10px; }

.piece-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.piece-table-wrap { overflow-x: auto; }

.piece-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.piece-table th {
  padding: 4px 6px 8px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.piece-table td {
  padding: 4px;
  text-align: center;
}

.piece-table .piece-input {
  width: 100%;
  min-width: 64px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  text-align: center;
}

.piece-table .piece-input:focus { outline: none; border-color: var(--sky-600); box-shadow: var(--ring); }

.btn-remove-piece {
  width: 36px;
  padding: 0 !important;
  color: var(--muted) !important;
}

.btn-remove-piece:hover { border-color: #f1c9cb !important; background: var(--red-50) !important; color: var(--red-600) !important; }

.modal-error {
  display: block;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-50);
  color: var(--red-700);
  font-size: 13px;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.modal-form > .modal-actions { margin-top: 18px; }
.modal-actions > * + * { margin-left: 10px; }

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  top: 86px;
  left: 50%;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: calc(100% - 32px);
  max-width: 460px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: var(--navy-800);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 18px 44px rgba(5, 28, 42, 0.28);
  pointer-events: auto;
  animation: toast-in 0.32s var(--ease) both;
}

.toast.is-leaving { animation: toast-out 0.24s ease both; }

.toast-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(64, 196, 125, 0.18);
  color: #5fe09a;
  font-size: 15px;
}

.toast-error .toast-icon { background: rgba(255, 120, 124, 0.18); color: #ff8c90; }

.toast-body { flex: 1; min-width: 0; line-height: 1.5; }
.toast-body strong { display: block; font-size: 14px; }
.toast-body span { color: rgba(255, 255, 255, 0.74); }

.toast-body a {
  display: inline-block;
  margin-top: 4px;
  color: #9fd4ee;
  font-weight: 700;
  text-decoration: none;
}

.toast-body a:hover { text-decoration: underline; }

@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Bookings ---------- */

.booking-table { min-width: 880px; }

.booking-no {
  color: var(--navy-700);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.route-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy-700);
  font-family: var(--font-display);
  font-weight: 800;
  white-space: nowrap;
}

.route-inline svg { color: var(--red-600); font-size: 14px; transform: rotate(45deg); }

.booking-table .cell-num,
.booking-table .cell-amount {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.booking-table .cell-amount { color: var(--navy-700); font-weight: 800; }
.booking-table .cell-time { color: var(--muted); white-space: nowrap; }
.booking-table .cell-actions { white-space: nowrap; }
.booking-table .cell-actions .btn-sm + .btn-sm { margin-left: 6px; }

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-tag.status-pending_review { background: var(--amber-50); color: var(--amber-700); }
.status-tag.status-approved { background: var(--green-50); color: var(--green-600); }
.status-tag.status-rejected { background: var(--red-50); color: var(--red-700); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line-soft);
}

.pager:empty { display: none; }

.pager-info {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .search-form { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); }
  .search-form-pod { grid-template-columns: minmax(0, 1fr) auto; }
  .field-airline { grid-column: 1 / 3; }
  .btn-search { width: 100%; }
}

@media (max-width: 860px) {
  .brand-copy { display: none; }
  .today { display: none; }
  .hero { padding: 40px 32px 104px; background-position: 62% 50%; }
  .hero::before { background: linear-gradient(90deg, rgba(6, 29, 43, 0.92), rgba(9, 45, 66, 0.66) 70%, rgba(9, 45, 66, 0.3)); }
  .search-card { margin: -72px 14px 0; }
  .result-card-raised { margin: -64px 14px 0; }
}

@media (max-width: 760px) {
  body { font-size: 13.5px; }
  .wrap { width: calc(100% - 24px); }
  .topbar-inner { min-height: 60px; gap: 10px; }
  .brand-logo { height: 34px; }
  .topbar-right > * + * { margin-left: 8px; }
  .btn-client-login { height: 34px; padding: 0 13px; font-size: 13px; }
  .user-chip { max-width: 150px; padding-right: 10px; }
  .user-meta small { display: none; }
  .nav-link { height: 34px; padding: 0 11px; font-size: 12.5px; }
  .nav-link-pill svg,
  .nav-back svg { display: none; }
  .btn-icon { width: 34px; height: 34px; }

  .page { padding-top: 12px; }

  .hero {
    min-height: 0;
    padding: 30px 22px 92px;
    border-radius: 18px;
  }

  .hero-title { font-size: 28px; }
  .hero-text { font-size: 13.5px; line-height: 1.7; }
  .hero-meta { margin-top: 16px; gap: 6px; }
  .hero-meta li { padding: 5px 10px; font-size: 11.5px; }
  .hero-compact { padding-bottom: 84px; }

  .search-card { margin: -68px 8px 0; padding: 18px 16px; border-radius: 16px; }
  .search-card-head { display: block; margin-bottom: 14px; padding-bottom: 12px; }
  .search-card-head p { margin-top: 6px; }
  .search-form { grid-template-columns: 1fr; gap: 10px; }
  .field-airline { grid-column: auto; }

  .btn-swap {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    margin: -12px auto -12px;
    transform: rotate(90deg);
  }

  .btn-swap:hover { transform: rotate(270deg); }
  .btn-search { margin-top: 4px; }

  .result-card { margin-top: 16px; border-radius: 16px; }
  .result-card-raised { margin: -60px 8px 0; }
  .result-head { flex-direction: column; align-items: flex-start; gap: 4px; min-height: 0; padding: 14px 16px; }

  .table-wrap { overflow: visible; padding: 12px; background: var(--surface-soft); }
  .rate-table { display: block; min-width: 0; }
  .rate-table thead { display: none; }
  .rate-table tbody { display: grid; gap: 12px; }

  .rate-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .rate-table tbody td,
  .rate-table tbody tr:hover td {
    display: block;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    text-align: left;
  }

  .rate-table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
  }

  .rate-table .cell-route {
    grid-column: 1 / -1;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--line-soft);
  }

  .route { justify-content: space-between; }
  .route-line { flex: 1; max-width: 120px; }
  .port:last-child { align-items: flex-end; text-align: right; }
  .port b { font-size: 18px; }

  .booking-table .airline-name { display: none; }

  .rate-table td.price,
  .rate-table tbody tr:hover td.price {
    border: 0;
    background: var(--sky-50);
    font-size: 15px;
  }

  .rate-table td.price:nth-of-type(n+5):nth-of-type(-n+7) { padding-top: 12px; }
  .rate-table td.price:nth-of-type(n+8):nth-of-type(-n+10) { padding-bottom: 12px; }

  .rate-table .remark { order: 21; grid-column: 1 / -1; min-width: 0; max-width: none; }
  .rate-table .remark:empty { display: none; }

  .rate-table tbody .rate-row td:first-child { padding: 12px 14px 4px; grid-column: span 2; }
  .rate-table .rate-row .airline-name { color: var(--navy-700); font-size: 14px; font-weight: 700; }
  .rate-table .rate-row .cell-freq { padding: 12px 14px 4px; color: var(--muted); font-size: 12px; text-align: right; }
  .rate-table .rate-row .cell-transit { order: -1; grid-column: 1 / 2; min-width: 0; padding: 4px 0 12px 14px; }
  .rate-table .rate-row .cell-cargo { order: -1; grid-column: 2 / 4; min-width: 0; padding: 4px 14px 12px 6px; }
  .rate-table .rate-row .cargo { flex-wrap: wrap; white-space: normal; }
  .rate-table .rate-row .cell-none { display: none; }
  .rate-table .rate-row .pack-text { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: #f1f4f6; color: var(--text-soft); font-size: 12px; font-weight: 600; }
  .rate-table .rate-row .cell-freq { order: -2; }
  .rate-table .rate-row .cell-airline { order: -3; }

  .rate-table tbody tr.group-row { display: block; overflow: visible; margin-top: 4px; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .rate-table tbody tr.group-row td,
  .rate-table tbody tr.group-row:hover td { display: block; padding: 0; border: 0; background: transparent; }
  .rate-table tbody .group-row:not(:first-child) td { border-top: 0; }
  .group-head { min-height: 0; padding: 2px 4px; }
  .group-head > * + * { margin-left: 8px; }
  .group-head .route-line { flex: 0 0 18px; width: 18px; }
  .group-head .route-line::before { display: none; }
  .group-head .route-line svg,
  .rate-table tbody tr:hover .group-head .route-line svg { padding: 0; background: transparent; }
  .gh-pol { font-size: 12px; }
  .gh-via { height: 22px; padding: 0 7px; font-size: 12px; }
  .gh-via-name,
  .group-head.has-via .gh-pol-name { display: none; }
  /* Long airport names shorten instead of wrapping the route onto two lines (min-width: 0 keeps
     the grid from widening to fit them). */
  .rate-table tbody tr.group-row,
  .rate-table tbody tr.group-row td { min-width: 0; }
  .gh-pol,
  .gh-city { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gh-pod,
  .gh-via,
  .group-head .route-line,
  .group-head.has-via .gh-pol,
  .gh-count { flex-shrink: 0; }
  .gh-count { margin-left: auto; padding: 0; border: 0; background: transparent; color: var(--muted); font-weight: 500; }

  .rate-table .col-action,
  .rate-table tbody tr:hover .col-action {
    position: static;
    order: 30;
    grid-column: 1 / -1;
    padding: 0 14px 14px;
    box-shadow: none;
  }

  .rate-table .col-action .btn-book {
    justify-content: center;
    width: 100%;
    height: 40px;
    font-size: 13.5px;
  }

  .rate-table .state-row { display: block; border: 0; box-shadow: none; background: transparent; }
  .rate-table .state-row td { display: block; padding: 0; }
  .state { padding: 36px 12px; }

  .booking-table .cell-no { order: -3; grid-column: span 2; padding-top: 14px; }
  .booking-table .cell-status { order: -2; padding-top: 14px; text-align: right; }
  .booking-table .cell-route { order: -1; grid-column: span 2; padding: 0 14px 12px; border-bottom: 1px solid var(--line-soft); }
  .booking-table .cell-time { order: -1; padding: 2px 14px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12px; line-height: 1.35; text-align: right; white-space: normal; }
  .booking-table .cell-time::before { display: none !important; }
  .booking-table .cell-amount { grid-column: span 2; }
  .booking-table tbody td:nth-of-type(n+6):nth-of-type(-n+7) { padding-bottom: 14px; }
  .booking-no { font-size: 15px; }
  .route-inline { font-size: 16px; }

  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-card,
  .modal-card-wide { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-head { padding: 18px 18px 0; }
  .modal-form { padding: 16px 18px 20px; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .booking-route { flex-wrap: wrap; gap: 10px; }
  .br-airline { flex-basis: 100%; flex-direction: row; align-items: baseline; gap: 8px; padding: 10px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.18); border-left: 0; }
  .modal-actions .btn-primary,
  .modal-actions .btn-ghost { flex: 1; }

  .toast-stack { top: 72px; }

  .footer { flex-direction: column; gap: 4px; margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Date field + calendar (js/date-picker.js), same as the admin console's date-picker. The modal
   input rule sets the background shorthand, so the icon needs the same specificity (and comes later). */
.date-picker-input,
.modal-form input.date-picker-input {
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23687b8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-size: 15px;
  background-repeat: no-repeat;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.date-picker-panel {
  position: fixed;
  z-index: 1300;
  box-sizing: border-box;
  width: 268px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(16, 47, 64, 0.18);
  user-select: none;
}
.date-picker-head { display: flex; align-items: center; margin-bottom: 6px; }
.date-picker-title { flex: 1; color: var(--navy-800); font-size: 14px; font-weight: 700; text-align: center; }
.date-picker-nav,
.date-picker-day,
.date-picker-link { border: 0; background: transparent; font: inherit; cursor: pointer; }
.date-picker-nav { width: 28px; height: 28px; border-radius: 7px; color: var(--muted); font-size: 16px; line-height: 1; }
.date-picker-nav:hover { background: var(--sky-50); color: var(--navy-800); }
.date-picker-week,
.date-picker-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.date-picker-week span { padding: 4px 0; color: var(--muted); font-size: 12px; text-align: center; }
.date-picker-day { height: 32px; margin: 1px; border-radius: 7px; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.date-picker-day.is-outside { color: var(--faint); }
.date-picker-day.is-active { background: var(--sky-50); }
.date-picker-day.is-today { box-shadow: inset 0 0 0 1px var(--sky-600); }
.date-picker-day.is-selected { background: var(--red-600); color: #fff; font-weight: 700; }
.date-picker-foot { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.date-picker-link { padding: 4px 6px; border-radius: 6px; color: var(--sky-600); font-size: 13px; font-weight: 600; }
.date-picker-link:hover { background: var(--sky-50); }
