:root {
  --brand-navy: #1e4b82;
  --brand-teal: #268b97;
  --brand-green: #4aad82;
  --brand-red: #db242a;
  --brand-charcoal: #504a45;
  --brand-paper: #fcf9f4;
  --brand-white: #ffffff;
  --ink: #182334;
  --muted: #697483;
  --line: #d9e2ec;
  --soft: #f5f8fb;
  --shadow: 0 18px 44px rgba(30, 75, 130, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--brand-paper);
  font-family: Arial, Helvetica, sans-serif;
}

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

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(30, 75, 130, 0.14);
  background: rgba(252, 249, 244, 0.94);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand img {
  display: block;
  width: min(330px, 52vw);
  height: auto;
}

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

.topnav a {
  color: var(--brand-navy);
  font-weight: 700;
  text-decoration: none;
}

.nav-login {
  min-height: 40px;
  padding: 0 16px;
  border: 2px solid var(--brand-navy);
  border-radius: 8px;
  color: var(--brand-white);
  background: var(--brand-navy);
  cursor: pointer;
  font-weight: 800;
}

.menu-button {
  width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  border: 2px solid var(--brand-navy);
  border-radius: 8px;
  background: var(--brand-navy);
  cursor: pointer;
}

.menu-button span {
  width: 20px;
  height: 2px;
  display: block;
  background: var(--brand-white);
  border-radius: 999px;
}

.workspace {
  height: calc(100vh - 144px);
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.2fr);
  margin-top: 76px;
  margin-bottom: 68px;
  overflow: hidden;
}

.journey-panel,
.results-shell {
  padding: clamp(20px, 4vw, 42px);
}

.journey-panel {
  height: 100%;
  overflow: auto;
  background:
    linear-gradient(145deg, rgba(38, 139, 151, 0.11), rgba(74, 173, 130, 0.1)),
    var(--brand-paper);
  border-right: 1px solid rgba(30, 75, 130, 0.14);
}

.results-panel {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  background: var(--brand-white);
}

.media-band {
  position: relative;
  height: clamp(150px, 24vh, 230px);
  overflow: hidden;
  background: var(--brand-navy);
}

.media-band video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video-sound-toggle {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--brand-white);
  border-radius: 8px;
  color: var(--brand-navy);
  background: var(--brand-white);
  box-shadow: 0 10px 24px rgba(24, 35, 52, 0.22);
  cursor: pointer;
  font-weight: 900;
}

.panel-heading {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
}

.row-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.eyebrow {
  margin: 0;
  color: var(--brand-teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--brand-navy);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.journey-form,
.booking-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span,
legend {
  color: var(--brand-charcoal);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-white);
  color: var(--ink);
  min-height: 48px;
  padding: 12px 13px;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(38, 139, 151, 0.18);
}

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

.field-grid.three {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 112px;
}

.vias {
  display: grid;
  gap: 10px;
}

.via-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: end;
}

.vehicle-picker {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.vehicle-picker legend {
  grid-column: 1 / -1;
}

.vehicle-picker label {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-white);
  cursor: pointer;
}

.vehicle-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vehicle-picker label:has(input:checked) {
  color: var(--brand-white);
  border-color: var(--brand-navy);
  background: var(--brand-navy);
}

.vehicle-picker label:has(input:checked) span {
  color: var(--brand-white);
}

.actions,
.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.compact-actions {
  justify-content: flex-start;
}

.button {
  min-height: 46px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  color: var(--brand-white);
  background: var(--brand-navy);
  border-color: var(--brand-navy);
}

.button.secondary {
  color: var(--brand-navy);
  background: var(--brand-white);
  border-color: var(--brand-teal);
}

.button.quiet {
  color: var(--brand-charcoal);
  background: transparent;
  border-color: transparent;
}

.button.icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--brand-red);
  background: var(--brand-white);
  border-color: var(--line);
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.status-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--brand-navy);
  background: rgba(38, 139, 151, 0.13);
  font-size: 12px;
  font-weight: 800;
}

.summary-block,
.quote-card,
.booking-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-white);
  box-shadow: var(--shadow);
}

.summary-block {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.summary-block span {
  color: var(--muted);
}

.quotes-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.quote-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.quote-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.supplier-name {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.quote-meta,
.quote-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.quote-tag {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-charcoal);
  font-weight: 700;
}

.quote-price {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.quote-price strong {
  color: var(--brand-navy);
  font-size: 28px;
}

.booking-form {
  margin-top: 18px;
  padding: 18px;
}

.selected-quote {
  padding: 14px;
  border-left: 5px solid var(--brand-green);
  background: var(--soft);
}

.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 35, 52, 0.48);
}

.modal.hidden {
  display: none;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 55;
}

.drawer.hidden {
  display: none;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(24, 35, 52, 0.38);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(340px, 92vw);
  min-height: 100%;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  background: var(--brand-white);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 46px rgba(24, 35, 52, 0.24);
}

.drawer-heading {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.drawer-heading strong {
  color: var(--brand-navy);
  font-size: 22px;
}

.drawer-heading .modal-close {
  position: static;
}

.drawer-item {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-navy);
  background: var(--brand-white);
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.drawer-item:hover {
  border-color: var(--brand-navy);
  background: var(--soft);
}

.modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(840px, calc(100vh - 36px));
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--brand-white);
  box-shadow: 0 28px 80px rgba(24, 35, 52, 0.32);
  padding: clamp(20px, 4vw, 34px);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-charcoal);
  background: var(--brand-white);
  cursor: pointer;
  font-weight: 800;
}

.login-form,
.portal-view {
  display: grid;
  gap: 18px;
}

.portal-page {
  min-height: calc(100vh - 144px);
  margin-top: 76px;
  margin-bottom: 68px;
  padding: clamp(20px, 4vw, 48px);
  background:
    linear-gradient(145deg, rgba(38, 139, 151, 0.08), rgba(74, 173, 130, 0.08)),
    var(--brand-paper);
}

.portal-page.hidden {
  display: none;
}

.portal-page .portal-view {
  max-width: 1360px;
  margin: 0 auto;
}

.portal-view.hidden {
  display: none;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
}

.portal-card {
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-white);
  box-shadow: var(--shadow);
}

.portal-card h3 {
  margin: 0 0 8px;
  color: var(--brand-navy);
  font-size: 18px;
}

.portal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-layout {
  min-height: calc(100vh - 172px);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--brand-white);
  box-shadow: var(--shadow);
}

.admin-sidebar {
  min-height: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  color: var(--brand-white);
  background: var(--brand-navy);
}

.admin-sidebar-brand {
  display: grid;
  gap: 6px;
  padding: 6px 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 8px;
}

.admin-sidebar-brand .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.admin-sidebar-brand strong {
  color: var(--brand-white);
  font-size: 24px;
  line-height: 1;
}

.admin-menu-item {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--brand-white);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.admin-menu-item:hover,
.admin-menu-item.active {
  color: var(--brand-navy);
  border-color: var(--brand-white);
  background: var(--brand-white);
}

.admin-submenu {
  display: grid;
  gap: 6px;
  padding: 0 0 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  margin-bottom: 8px;
}

.admin-submenu-item {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.admin-submenu-item:hover,
.admin-submenu-item.active {
  color: var(--brand-navy);
  background: var(--brand-white);
}

.admin-logout {
  margin-top: auto;
  color: var(--brand-white);
  border-color: rgba(255, 255, 255, 0.35);
}

.admin-content {
  min-width: 0;
  background: var(--brand-white);
  padding: clamp(18px, 3vw, 30px);
}

.admin-section {
  display: grid;
  gap: 16px;
}

.admin-section.hidden {
  display: none;
}

.admin-section h3 {
  margin: 0;
  color: var(--brand-navy);
  font-size: clamp(26px, 4vw, 42px);
}

.admin-section p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.admin-form {
  display: grid;
  gap: 16px;
  max-width: 980px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.admin-form.modal-form {
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.supplier-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-white);
}

.supplier-options legend {
  padding: 0 6px;
}

.supplier-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-charcoal);
  font-size: 14px;
  font-weight: 800;
}

.supplier-options input {
  width: auto;
  min-height: auto;
}

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

.supplier-logo-preview {
  width: 148px;
  min-height: 82px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-white);
  overflow: hidden;
}

.supplier-logo-preview img {
  display: block;
  max-width: 100%;
  max-height: 82px;
  object-fit: contain;
}

.admin-list-wrap {
  display: grid;
  gap: 10px;
  max-width: 980px;
}

.admin-list-wrap h4 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 20px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.supplier-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-white);
}

.supplier-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  overflow: hidden;
  color: var(--brand-navy);
  font-weight: 900;
}

.supplier-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.supplier-row strong {
  color: var(--brand-navy);
}

.supplier-row .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.supplier-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--brand-navy);
  background: rgba(38, 139, 151, 0.13);
  font-size: 12px;
  font-weight: 900;
}

.supplier-actions {
  position: relative;
}

.supplier-actions-toggle {
  width: 40px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-navy);
  background: var(--brand-white);
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.supplier-actions-menu {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 8;
  width: 148px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-white);
  box-shadow: var(--shadow);
}

.supplier-actions-menu.hidden {
  display: none;
}

.supplier-actions-menu button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--brand-charcoal);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.supplier-actions-menu button:hover {
  color: var(--brand-navy);
  background: var(--soft);
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
}

.account-password-form {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.powered-by {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px clamp(18px, 4vw, 48px);
  border-top: 1px solid rgba(30, 75, 130, 0.14);
  background: var(--brand-white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.powered-by img {
  display: block;
  max-width: 150px;
  max-height: 34px;
  object-fit: contain;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .journey-panel {
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(30, 75, 130, 0.14);
  }

  .results-panel {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    height: auto;
    min-height: 76px;
  }

  .workspace,
  .portal-page {
    margin-top: 96px;
  }

  .topnav {
    justify-content: flex-end;
  }

  .field-grid,
  .field-grid.three,
  .vehicle-picker,
    .quote-card,
    .portal-grid,
    .admin-layout,
    .vehicle-map-grid,
    .supplier-row {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    min-height: auto;
  }

  .quote-price {
    justify-items: start;
  }
}
