@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --ink: #0f1d1e;
  --ink-secondary: #374b4d;
  --muted: #6b8082;
  --line: rgba(8, 107, 92, .10);
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #ffffff;
  --canvas: #f0f6f3;
  --brand: #07806a;
  --brand-dark: #065c4d;
  --brand-deep: #043d33;
  --brand-soft: #dcf3ec;
  --brand-glow: rgba(7, 128, 106, .15);
  --accent: #10b981;
  --warm: #f59e0b;
  --warm-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px rgba(7, 58, 48, .06), 0 1px 3px rgba(0, 0, 0, .04);
  --shadow-lg: 0 12px 40px rgba(7, 58, 48, .08), 0 4px 12px rgba(0, 0, 0, .03);
  --shadow-xl: 0 20px 50px rgba(7, 58, 48, .12), 0 8px 20px rgba(0, 0, 0, .04);
  --transition-fast: .15s cubic-bezier(.4, 0, .2, 1);
  --transition-medium: .25s cubic-bezier(.4, 0, .2, 1);
  --transition-slow: .4s cubic-bezier(.4, 0, .2, 1);
}

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

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(160deg, #e8f5f0 0%, #f0f6f3 30%, #f7f9f7 60%, #faf8f4 100%);
  background-attachment: fixed;
  font: 400 14px/1.5 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font: inherit; cursor: pointer; border: none; background: none; }

/* ── Shell ── */
.app-shell {
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px 28px 40px;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: white;
  background: linear-gradient(145deg, var(--brand), #0ea17d);
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(7, 128, 106, .3), inset 0 1px 0 rgba(255,255,255,.2);
  letter-spacing: -.02em;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
}
h2 {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13px;
}

.live-dot::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .2);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, .2); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, .08); }
}

/* ── Demo banner ── */
.demo-banner {
  border: 1px solid rgba(7, 128, 106, .15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--brand-dark);
  background: linear-gradient(135deg, rgba(220, 243, 236, .5), rgba(236, 252, 245, .4));
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}

.demo-banner strong {
  font-weight: 800;
}

/* ── Metrics ── */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metrics article {
  position: relative;
  min-height: 100px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  overflow: hidden;
}

.metrics article::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: radial-gradient(ellipse at top right, var(--brand-glow), transparent 70%);
  pointer-events: none;
}

.metrics article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.metrics strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--brand-dark);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
}

.metrics small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

/* ── Workspace grid ── */
.workspace {
  display: grid;
  grid-template-columns: minmax(250px, .9fr) minmax(480px, 2.1fr) minmax(280px, 1fr);
  gap: 16px;
}

/* ── Panels ── */
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-medium);
}

.panel:hover {
  box-shadow: var(--shadow-xl);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
}

/* ── Queue counter ── */
.counter {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  background: linear-gradient(135deg, var(--brand-soft), #c6ebe0);
  font-weight: 900;
  font-size: 13px;
}

/* ── Orders list ── */
.orders-list {
  padding: 0 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-card {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f7faf8, #f2f7f4);
  text-align: left;
  transition: all var(--transition-fast);
}

.order-card:hover {
  border-color: rgba(7, 128, 106, .2);
  background: linear-gradient(135deg, #edfaf5, #e8f7f1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.order-card.is-selected {
  border-color: var(--brand);
  background: linear-gradient(135deg, #e0f7ef, #d4f2e8);
  box-shadow: 0 0 0 3px var(--brand-glow), var(--shadow-sm);
}

.order-card .order-top,
.order-card .order-bottom {
  display: flex;
  justify-content: space-between;
  gap: 9px;
}

.order-card strong { font-size: 13px; font-weight: 700; }
.order-card small { color: var(--muted); font-size: 11px; }
.order-card .order-bottom { margin-top: 8px; align-items: flex-end; }

/* ── Tags ── */
.tag {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.tag { background: var(--brand-soft); color: var(--brand-dark); }
.tag.is-urgent { background: var(--warm-soft); color: #92400e; }

/* ── Buttons ── */
.full-width { width: calc(100% - 24px); margin: 0 12px 16px; }

.button {
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-weight: 700;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--brand), #0ea17d);
  box-shadow: 0 4px 14px rgba(7, 128, 106, .25), inset 0 1px 0 rgba(255,255,255,.15);
}

.button-primary:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  box-shadow: 0 6px 20px rgba(7, 128, 106, .3);
}

.button-primary.is-disabled {
  opacity: .5;
  pointer-events: none;
}

.button-quiet {
  border-color: var(--line);
  color: var(--ink-secondary);
  background: var(--surface-solid);
}

.button-quiet:hover {
  border-color: rgba(7, 128, 106, .2);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* ── Map panel ── */
.map-panel { display: flex; flex-direction: column; }

.map-status,
.channel-badge {
  white-space: nowrap;
  border-radius: 99px;
  padding: 5px 10px;
  color: var(--brand-dark);
  background: linear-gradient(135deg, var(--brand-soft), #c6ebe0);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* ── Map canvas ── */
.map-canvas {
  position: relative;
  flex: 1;
  min-height: 450px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(16, 185, 129, .06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(7, 128, 106, .04) 0%, transparent 50%),
    linear-gradient(160deg, #f0f7f3, #e4efe8, #f2f5ee);
}

.roads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.roads path {
  fill: none;
  stroke: rgba(180, 200, 190, .5);
  stroke-linecap: round;
  stroke-width: 14;
}

.roads path:nth-child(even) {
  stroke: rgba(195, 210, 200, .4);
  stroke-width: 8;
}

.map-label {
  position: absolute;
  top: 18px;
  right: 20px;
  color: rgba(120, 150, 140, .6);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

/* ── Map pins ── */
.place, .rider {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: 30px auto;
  column-gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1.5px solid rgba(255, 255, 255, .95);
  border-radius: 13px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(45, 74, 60, .12), 0 2px 4px rgba(0, 0, 0, .04);
  transition: all var(--transition-medium);
}

.place:hover, .rider:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 28px rgba(45, 74, 60, .16);
}

.place strong, .rider b { font-size: 12px; font-weight: 700; }
.place small, .rider small { color: var(--muted); font-size: 10px; font-weight: 500; }

.place-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff5e6, #ffe8cc);
  font-size: 16px;
}

.restaurant-place { top: 34%; left: 23%; }
.client-place { right: 12%; bottom: 15%; }

/* ── Riders ── */
.rider {
  grid-template-columns: 28px auto;
  padding: 8px 10px;
  background: linear-gradient(145deg, #1a3530, #243f3a);
  border-color: rgba(255, 255, 255, .1);
  color: white;
  transform: translate3d(0, 0, 0);
  transition: left .8s cubic-bezier(.4, 0, .2, 1), top .8s cubic-bezier(.4, 0, .2, 1), background var(--transition-medium), box-shadow var(--transition-medium);
}

.rider small { color: #a8d5c4; }
.rider span { grid-row: span 2; font-size: 19px; }

.rider-one { left: 63%; top: 23%; }
.rider-two { left: 43%; bottom: 16%; }
.rider-three { right: 17%; top: 35%; }

.rider.is-assigned {
  left: 38%;
  top: 31%;
  background: linear-gradient(145deg, var(--brand), #0ea17d);
  box-shadow: 0 8px 24px rgba(7, 128, 106, .35);
}

.rider.is-delivering {
  left: 62%;
  top: 64%;
  background: linear-gradient(145deg, #0369a1, #0891b2);
  box-shadow: 0 8px 24px rgba(3, 105, 161, .3);
}

/* ── Routes ── */
.route {
  position: absolute;
  z-index: 2;
  height: 0;
  border-top: 3px dashed transparent;
  transform-origin: 0 50%;
  transition: border-color var(--transition-medium);
}

.route.is-visible {
  border-color: var(--warm);
  animation: route-pulse 2s ease-in-out infinite;
}

@keyframes route-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.route-to-restaurant { width: 184px; top: 37%; left: 39%; transform: rotate(166deg); }
.route-to-client { width: 221px; top: 43%; left: 27%; transform: rotate(31deg); }

/* ── Dispatch bar ── */
.dispatch-bar {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(240, 248, 244, .6), rgba(255,255,255,.4));
}

.dispatch-bar span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.dispatch-bar strong { font-size: 13px; font-weight: 700; }

/* ── Chat panel ── */
.chat-panel { display: flex; flex-direction: column; }

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  padding: 0 20px 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.online-status {
  color: var(--accent);
  font-weight: 700;
}

/* ── Chat window ── */
.chat-window {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 315px;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f5faf7, #f0f6f2);
  overflow: auto;
  scroll-behavior: smooth;
}

/* ── Chat bubbles ── */
.bubble {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 12.5px;
  line-height: 1.4;
  animation: bubble-in .3s cubic-bezier(.4, 0, .2, 1);
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bubble.customer {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: linear-gradient(135deg, #d0f0e4, #c4ebda);
  color: var(--brand-deep);
}

.bubble.agent {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: var(--surface-solid);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.bubble strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* ── Quick replies ── */
.quick-replies {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px;
}

.quick-replies button {
  padding: 10px 6px;
  border: 1.5px solid rgba(7, 128, 106, .12);
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  background: var(--surface-solid);
  font-size: 11px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.quick-replies button:hover {
  background: var(--brand-soft);
  border-color: rgba(7, 128, 106, .25);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ── Handoff card ── */
.handoff-card {
  display: flex;
  gap: 10px;
  margin: 0 14px 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, .2);
  color: #78350f;
  background: linear-gradient(135deg, #fefce8, #fef9c3);
}

.handoff-icon {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: #92400e;
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  font-weight: 900;
  font-size: 14px;
}

.handoff-card strong { font-size: 12px; font-weight: 800; }
.handoff-card p { margin: 3px 0 0; font-size: 11px; line-height: 1.4; }

/* ── Flow / B2B section ── */
.flow-section {
  display: grid;
  grid-template-columns: .85fr 2.15fr;
  gap: 28px;
  align-items: center;
  margin-top: 20px;
  padding: 28px 32px;
  border: none;
  border-radius: var(--radius-xl);
  color: white;
  background: linear-gradient(125deg, #042f28 0%, #065c4d 40%, #0a8068 100%);
  box-shadow: 0 16px 48px rgba(4, 47, 40, .25), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
  position: relative;
}

.flow-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(16, 185, 129, .1) 0%, transparent 60%);
  pointer-events: none;
}

.flow-heading .eyebrow { color: #6ee7b7; }
.flow-heading h2 { font-size: 20px; line-height: 1.35; font-weight: 800; }

.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
  z-index: 1;
}

.flow-steps li {
  min-height: 105px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: background var(--transition-fast);
}

.flow-steps li:hover {
  background: rgba(255, 255, 255, .14);
}

.flow-steps span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 10px;
  border-radius: 50%;
  color: var(--brand-deep);
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  font-size: 11px;
  font-weight: 900;
}

.flow-steps strong,
.flow-steps small { display: block; }
.flow-steps strong { font-size: 13px; font-weight: 700; }
.flow-steps small { margin-top: 4px; color: rgba(209, 250, 229, .7); font-size: 10.5px; line-height: 1.35; }

/* ── Footer ── */
.footer-note {
  padding: 20px 0 4px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
}

/* ── Responsive ── */
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr 1.55fr; }
  .chat-panel { grid-column: span 2; }
  .flow-section { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .app-shell { padding: 16px; }
  .topbar, .top-actions { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 1fr; }
  .chat-panel { grid-column: auto; }
  .map-canvas { min-height: 360px; }
  .dispatch-bar { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: repeat(2, 1fr); }
  .rider-one { left: 57%; }
  .restaurant-place { left: 8%; }
  .client-place { right: 4%; }
  .flow-section { padding: 20px; }
  h1 { font-size: 20px; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .quick-replies { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr; }
}
