:root {
  color-scheme: light;
  --ink: #10201a;
  --muted: #66726d;
  --soft: #eef3ef;
  --surface: #fbfcfa;
  --surface-strong: #ffffff;
  --line: #d8e1dc;
  --green: #0f7a4f;
  --green-strong: #075c3b;
  --coral: #db5b42;
  --gold: #e4ac3f;
  --blue: #286f8f;
  --shadow: 0 18px 42px rgba(21, 44, 35, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--soft);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(238, 243, 239, 0.88)),
    var(--soft);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

.brand-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px;
  color: #f8fff9;
  background: #0e211b;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 1.08rem;
}

.brand-lockup small {
  margin-top: 2px;
  color: rgba(248, 255, 249, 0.68);
}

.role-switch {
  display: grid;
  gap: 8px;
}

.role-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 8px;
  color: rgba(248, 255, 249, 0.72);
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.role-tab:hover,
.role-tab.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.tab-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.store-visual {
  position: relative;
  min-height: 270px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(10, 18, 14, 0.06), rgba(10, 18, 14, 0.72)),
    url("https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=900&q=80");
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.store-visual div {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
}

.store-visual span,
.store-visual strong {
  display: block;
}

.store-visual span {
  color: rgba(248, 255, 249, 0.74);
  font-size: 0.86rem;
}

.store-visual strong {
  margin-top: 4px;
  color: #ffffff;
  font-size: 1.32rem;
}

.store-meta {
  display: grid;
  gap: 10px;
  color: rgba(248, 255, 249, 0.72);
  font-size: 0.92rem;
  line-height: 1.45;
}

.store-meta p {
  margin: 0;
}

.store-meta a {
  width: fit-content;
  color: #ffffff;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.view {
  display: none;
  min-height: calc(100vh - 44px);
  animation: surfaceIn 280ms ease both;
}

.view.is-active {
  display: block;
}

[hidden] {
  display: none !important;
}

@keyframes surfaceIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h1,
.panel-heading h2,
.queue-summary h2 {
  margin: 2px 0 0;
}

.topbar h1 {
  max-width: 680px;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.96;
}

.panel-heading h2,
.queue-summary h2 {
  font-size: 1.18rem;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.promo-view {
  min-height: calc(100vh - 44px);
}

.hero-panel {
  display: grid;
  min-height: min(720px, calc(100vh - 44px));
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(11, 25, 20, 0.84), rgba(11, 25, 20, 0.42) 48%, rgba(11, 25, 20, 0.12)),
    url("https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=1800&q=82");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.hero-copy {
  width: min(680px, 100%);
  padding: clamp(28px, 7vw, 72px);
}

.hero-copy .eyebrow {
  color: #dbeee4;
}

.hero-copy h1 {
  margin: 6px 0 14px;
  font-size: clamp(4rem, 11vw, 9.5rem);
  line-height: 0.86;
}

.hero-copy p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-actions .secondary-button {
  border-color: rgba(255, 255, 255, 0.36);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.promo-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.promo-band div {
  min-height: 190px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.84);
}

.promo-band h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.45rem, 2.4vw, 2.35rem);
  line-height: 1;
}

.promo-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.primary-button {
  padding: 0 16px;
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(15, 122, 79, 0.22);
}

.primary-button:hover {
  background: var(--green-strong);
  transform: translateY(-1px);
}

.primary-button span:last-child {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: var(--green-strong);
  background: #ffffff;
  font-size: 0.82rem;
}

.secondary-button,
.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-strong);
}

.secondary-button {
  padding: 0 14px;
}

.secondary-button.is-live {
  color: var(--green-strong);
  border-color: rgba(15, 122, 79, 0.34);
  background: rgba(15, 122, 79, 0.08);
}

.ghost-button {
  padding: 0 12px;
  color: var(--muted);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: rgba(15, 122, 79, 0.34);
  color: var(--green-strong);
  transform: translateY(-1px);
}

.text-button {
  min-height: 34px;
  padding: 0;
  color: var(--coral);
  background: transparent;
}

.full-width {
  width: 100%;
}

.customer-grid,
.delivery-grid {
  display: grid;
  align-items: start;
  gap: 18px;
  transition: grid-template-columns 280ms ease;
}

.customer-grid {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
}

.customer-main {
  display: grid;
  gap: 18px;
}

.delivery-grid {
  grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
}

.delivery-grid.is-route-focus {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.market-panel,
.cart-panel,
.tracker-panel,
.queue-panel,
.delivery-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.market-panel,
.queue-panel,
.delivery-detail {
  min-height: 680px;
}

.delivery-grid.is-route-focus .queue-panel {
  box-shadow: 0 12px 24px rgba(21, 44, 35, 0.08);
}

.tracker-panel {
  overflow: hidden;
}

.tracker-empty {
  display: grid;
  min-height: 210px;
  align-items: center;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(15, 122, 79, 0.08), transparent),
    rgba(255, 255, 255, 0.84);
}

.tracker-empty h2,
.tracker-header h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.55rem, 2.8vw, 2.6rem);
  line-height: 1;
}

.tracker-empty p,
.tracker-header p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tracker-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.tracker-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 1px;
  background: var(--line);
}

.tracker-map {
  min-height: 220px;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.tracker-info {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.metric {
  display: grid;
  align-content: center;
  min-height: 72px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  margin-top: 4px;
  font-size: 1.02rem;
}

.tracker-timeline {
  padding: 14px;
  margin-top: 0;
  border-top: 1px solid var(--line);
}

.catalog-tools {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: rgba(251, 252, 250, 0.94);
  backdrop-filter: blur(14px);
}

.search-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

.search-control input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.category-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-weight: 800;
}

.category-tab.is-active {
  border-color: rgba(15, 122, 79, 0.2);
  color: #ffffff;
  background: var(--green);
}

.catalog-list,
.order-list {
  display: grid;
}

.catalog-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.catalog-item:hover {
  background: rgba(15, 122, 79, 0.04);
}

.product-swatch {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
}

.product-main {
  min-width: 0;
}

.product-main h3 {
  margin: 0;
  font-size: 1rem;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(219, 91, 66, 0.12);
  color: #98402f;
  font-size: 0.76rem;
  font-weight: 800;
}

.product-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.product-actions strong {
  font-size: 0.98rem;
  white-space: nowrap;
}

.add-button,
.quantity-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-size: 1.12rem;
  font-weight: 900;
}

.cart-panel {
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 44px);
  overflow: auto;
}

.panel-heading,
.queue-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.cart-items {
  display: grid;
  min-height: 120px;
}

.cart-empty,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.cart-line h3 {
  margin: 0 0 4px;
  font-size: 0.96rem;
}

.cart-line p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-button {
  width: 30px;
  height: 30px;
  color: var(--ink);
  background: var(--soft);
}

.totals {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.totals strong {
  color: var(--ink);
}

.grand-total {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 1.08rem;
}

.checkout-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.checkout-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.payment-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.payment-field legend {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.checkout-form .payment-option {
  position: relative;
  display: block;
  color: var(--ink);
  cursor: pointer;
}

.payment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-option span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 900;
}

.payment-option input:checked + span {
  border-color: rgba(15, 122, 79, 0.24);
  color: #ffffff;
  background: var(--green);
}

.checkout-form input,
.checkout-form textarea,
.queue-summary select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
  color: var(--ink);
}

.checkout-form input {
  min-height: 42px;
  padding: 0 11px;
}

.checkout-form textarea {
  resize: vertical;
  min-height: 82px;
  padding: 11px;
}

.checkout-form input:focus,
.checkout-form textarea:focus,
.queue-summary select:focus {
  border-color: rgba(15, 122, 79, 0.46);
  box-shadow: 0 0 0 4px rgba(15, 122, 79, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.location-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.manual-location {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.location-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-map,
.route-map {
  position: relative;
  overflow: hidden;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 122, 79, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 122, 79, 0.08) 1px, transparent 1px),
    #f5faf7;
  background-size: 28px 28px;
}

.live-map,
.mini-map.leaflet-container,
.route-map.leaflet-container {
  min-height: 240px;
  width: 100%;
  background: #dfece5;
}

.mini-map.leaflet-container {
  min-height: 150px;
}

.tracker-map.leaflet-container {
  min-height: 260px;
}

.mini-map.leaflet-container::before,
.route-map.leaflet-container::before,
.live-map.leaflet-container::before {
  display: none;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(90deg, rgba(15, 122, 79, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 122, 79, 0.08) 1px, transparent 1px),
    #f5faf7;
  background-size: 28px 28px;
}

.leaflet-pin {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(16, 32, 26, 0.24);
  font-size: 0.68rem;
  font-weight: 900;
}

.leaflet-pin.customer {
  background: var(--coral);
}

.leaflet-pin.driver {
  background: var(--blue);
  animation: pulsePin 1.8s ease-in-out infinite;
}

.leaflet-control-attribution {
  font-size: 0.65rem;
}

.mini-map::before,
.route-map::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-top: 3px solid rgba(40, 111, 143, 0.34);
  border-right: 3px solid rgba(40, 111, 143, 0.34);
  border-radius: 40% 18% 35% 20%;
  transform: rotate(-8deg);
}

.map-pin {
  position: absolute;
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px 999px 999px 0;
  color: #ffffff;
  background: var(--coral);
  font-size: 0.72rem;
  font-weight: 900;
  transform: rotate(-45deg);
  box-shadow: 0 10px 22px rgba(219, 91, 66, 0.24);
}

.map-pin span {
  transform: rotate(45deg);
}

.map-pin.store {
  top: 34%;
  left: 26%;
  background: var(--green);
}

.map-pin.customer {
  right: 24%;
  bottom: 26%;
}

.map-pin.driver {
  background: var(--blue);
}

.map-pin.driver.at-store {
  top: 24%;
  left: 31%;
}

.map-pin.driver.is-waiting {
  top: 42%;
  left: 47%;
  opacity: 0.74;
}

.map-pin.driver.is-live {
  top: 46%;
  left: 54%;
  animation: pulsePin 1.8s ease-in-out infinite;
}

@keyframes pulsePin {
  0%,
  100% {
    box-shadow: 0 10px 22px rgba(40, 111, 143, 0.2);
  }
  50% {
    box-shadow: 0 10px 26px rgba(40, 111, 143, 0.42);
  }
}

.queue-summary select {
  max-width: 150px;
  min-height: 38px;
  padding: 0 9px;
  font-weight: 800;
}

.order-card {
  width: 100%;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.order-card:hover,
.order-card.is-selected {
  background: rgba(15, 122, 79, 0.05);
}

.order-card.is-selected {
  box-shadow: inset 4px 0 0 var(--green);
}

.order-card h3,
.detail-title h2 {
  margin: 0;
}

.order-card-meta,
.detail-meta,
.timeline,
.item-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.order-card-meta,
.detail-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--green-strong);
  background: rgba(15, 122, 79, 0.12);
  font-size: 0.75rem;
  font-weight: 900;
}

.status-pill.delivered {
  color: #315d70;
  background: rgba(40, 111, 143, 0.12);
}

.delivery-detail {
  overflow: hidden;
  transition:
    transform 280ms ease,
    box-shadow 280ms ease,
    background 280ms ease;
}

.delivery-detail.is-route-focus {
  transform: translateY(-2px);
  background: rgba(248, 251, 249, 0.96);
  box-shadow: 0 24px 48px rgba(16, 32, 26, 0.16);
}

.detail-empty {
  display: grid;
  min-height: 680px;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.detail-header,
.detail-section,
.detail-actions {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.route-focus-callout {
  display: none;
  max-width: 300px;
  padding: 12px 14px;
  border: 1px solid rgba(40, 111, 143, 0.16);
  border-radius: 8px;
  background: rgba(40, 111, 143, 0.08);
}

.route-focus-callout.is-visible {
  display: grid;
  gap: 4px;
}

.route-focus-callout strong {
  font-size: 0.92rem;
}

.route-focus-callout span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.detail-title p,
.detail-section p {
  margin: 6px 0 0;
  color: var(--muted);
}

.detail-section h3 {
  margin: 0;
  font-size: 0.96rem;
}

.route-focus-shell {
  display: grid;
  gap: 1px;
}

.route-focus-shell.is-active {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.78fr);
  background: var(--line);
}

.route-focus-sidebar {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.route-stage,
.detail-card {
  background: rgba(255, 255, 255, 0.9);
}

.route-stage {
  min-height: 100%;
}

.route-stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.route-distance-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green-strong);
  background: rgba(15, 122, 79, 0.12);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.route-map--expanded,
.route-map--expanded.leaflet-container {
  min-height: 500px;
}

.detail-card--status,
.detail-card--customer {
  position: relative;
}

.customer-focus {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.customer-focus strong {
  font-size: 1.08rem;
}

.customer-focus span,
.customer-focus p {
  margin: 0;
}

.customer-focus-line {
  color: var(--ink);
  font-weight: 700;
}

.compact-meta {
  margin-top: 2px;
}

.route-live-meta {
  align-items: center;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  color: var(--muted);
  font-weight: 600;
}

.live-pill.is-live {
  background: rgba(15, 122, 79, 0.12);
  color: var(--green-strong);
}

.delivery-states {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.delivery-state {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft);
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.delivery-state.is-current {
  background: rgba(15, 122, 79, 0.12);
  transform: translateX(2px);
}

.delivery-state.is-done {
  background: rgba(40, 111, 143, 0.09);
}

.delivery-state-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
}

.delivery-state.is-current .delivery-state-marker,
.delivery-state.is-done .delivery-state-marker {
  color: #ffffff;
  background: var(--green);
}

.delivery-state strong,
.delivery-state small {
  display: block;
}

.delivery-state strong {
  font-size: 0.92rem;
}

.delivery-state small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.item-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--soft);
}

.route-map {
  min-height: 240px;
  margin-top: 12px;
}

.route-map .map-pin.store {
  top: 24%;
  left: 18%;
}

.route-map .map-pin.customer {
  right: 18%;
  bottom: 22%;
}

.tracker-map .map-pin.store {
  top: 24%;
  left: 18%;
}

.tracker-map .map-pin.customer {
  right: 16%;
  bottom: 22%;
}

.timeline {
  margin-top: 12px;
}

.timeline-step {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.8rem;
  font-weight: 900;
}

.timeline-step.is-done {
  color: #ffffff;
  background: var(--green);
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 0;
}

.staff-gate {
  display: grid;
  min-height: calc(100vh - 44px);
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  width: min(440px, 100%);
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.96;
}

.login-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.login-panel input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 11px;
  color: var(--ink);
  background: #ffffff;
}

.login-panel input:focus {
  border-color: rgba(15, 122, 79, 0.46);
  box-shadow: 0 0 0 4px rgba(15, 122, 79, 0.1);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 15px;
  border: 1px solid rgba(15, 122, 79, 0.24);
  border-radius: 8px;
  color: #ffffff;
  background: #10201a;
  box-shadow: var(--shadow);
  animation: toastIn 220ms ease both;
}

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

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

  .brand-rail {
    position: static;
    display: grid;
    grid-template-columns: 1fr auto;
    height: auto;
    padding: 14px;
  }

  .role-switch {
    grid-auto-flow: column;
    align-self: center;
  }

  .store-visual,
  .store-meta {
    display: none;
  }

  .customer-grid,
  .tracker-body,
  .route-focus-shell.is-active,
  .delivery-grid,
  .promo-band {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .brand-rail {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .role-switch {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    display: grid;
  }

  .topbar h1 {
    font-size: 2.25rem;
  }

  .form-row,
  .payment-field,
  .location-actions {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 620px;
    background:
      linear-gradient(180deg, rgba(11, 25, 20, 0.24), rgba(11, 25, 20, 0.88)),
      url("https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=1100&q=82");
    background-position: center;
    background-size: cover;
  }

  .hero-copy {
    padding: 28px;
  }

  .catalog-item {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .product-swatch {
    width: 48px;
    height: 48px;
  }

  .product-actions {
    grid-column: 2;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .detail-header {
    display: grid;
  }

  .route-stage-header {
    display: grid;
  }

  .route-map--expanded,
  .route-map--expanded.leaflet-container {
    min-height: 360px;
  }
}
