:root {
  --ink: #101512;
  --muted: #65716a;
  --paper: #f7f8f3;
  --surface: #ffffff;
  --line: #dfe5dc;
  --lime: #b7f34a;
  --green: #146b43;
  --coral: #ff6f61;
  --teal: #2aa7a1;
  --blue: #2457d6;
  --shadow: 0 24px 80px rgba(20, 30, 24, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background: var(--ink);
  color: #ffffff;
}

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

.brand-block img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #ffffff;
}

.brand-block strong,
.brand-block span,
.company-card span,
.company-card strong,
.company-card p {
  display: block;
}

.brand-block span,
.company-card span,
.company-card p {
  color: rgba(255, 255, 255, 0.66);
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-link,
.nav-tab {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: #ffffff;
  text-decoration: none;
  text-align: left;
}

.nav-link.active,
.nav-tab.active {
  background: var(--lime);
  color: var(--ink);
  font-weight: 900;
}

.company-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.company-card strong {
  margin-top: 8px;
}

.company-card p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

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

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.top-bar p,
.top-bar h1,
.panel-header p,
.panel-header h2,
.status-card p,
.muted {
  margin: 0;
}

.top-bar p {
  color: var(--green);
  font-weight: 900;
}

.top-bar h1 {
  margin-top: 4px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.ghost-button,
.match-card button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#clientView.active {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.phone-frame {
  overflow: hidden;
  border: 10px solid var(--ink);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.map-stage {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(42, 167, 161, 0.24), transparent 35%),
    linear-gradient(315deg, rgba(255, 111, 97, 0.18), transparent 34%),
    #e8eee5;
}

.city-grid,
.route-line {
  position: absolute;
  inset: 0;
}

.road {
  position: absolute;
  display: block;
  background: #fbfcf8;
  box-shadow: 0 0 0 1px rgba(16, 21, 18, 0.06);
}

.road-a {
  width: 120%;
  height: 30px;
  left: -8%;
  top: 28%;
  transform: rotate(-17deg);
}

.road-b {
  width: 120%;
  height: 24px;
  left: -9%;
  top: 61%;
  transform: rotate(12deg);
}

.road-c {
  width: 26px;
  height: 120%;
  left: 25%;
  top: -10%;
  transform: rotate(24deg);
}

.road-d {
  width: 26px;
  height: 120%;
  right: 22%;
  top: -10%;
  transform: rotate(-28deg);
}

.river {
  position: absolute;
  width: 120px;
  height: 130%;
  left: 50%;
  top: -15%;
  border-radius: 50%;
  background: rgba(42, 167, 161, 0.2);
  transform: rotate(18deg);
}

.park {
  position: absolute;
  display: block;
  border-radius: 8px;
  background: rgba(183, 243, 74, 0.35);
}

.park-one {
  width: 22%;
  height: 18%;
  left: 7%;
  bottom: 10%;
}

.park-two {
  width: 18%;
  height: 20%;
  right: 10%;
  top: 13%;
}

.map-topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-topbar div {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.map-topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.map-topbar strong {
  display: block;
  margin-top: 2px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.route-line::before {
  content: "";
  position: absolute;
  width: 68%;
  height: 46%;
  left: 18%;
  top: 31%;
  border: 7px solid var(--green);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(16deg);
  filter: drop-shadow(0 12px 18px rgba(20, 107, 67, 0.16));
}

.route-point {
  position: absolute;
  z-index: 4;
  width: 20px;
  height: 20px;
  border: 5px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(16, 21, 18, 0.25);
}

.pickup-point {
  left: 27%;
  top: 61%;
  background: var(--green);
}

.dropoff-point {
  left: 64%;
  top: 34%;
  background: var(--coral);
}

.driver-car {
  position: absolute;
  left: 45%;
  top: 44%;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 68px;
  height: 38px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: var(--lime);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  transform: rotate(-17deg);
  box-shadow: 0 18px 30px rgba(16, 21, 18, 0.22);
}

.booking-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
}

.panel-header p {
  color: var(--green);
  font-weight: 900;
}

.panel-header h2 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.booking-form,
.company-form {
  display: grid;
  gap: 10px;
}

.booking-form label,
.company-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.booking-form input,
.company-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #f9faf6;
  outline: none;
}

.booking-form input:focus,
.company-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 107, 67, 0.12);
}

.company-details {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.company-details div {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.company-details dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.company-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.switch-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

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

.vehicle-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.vehicle-card.active {
  border-color: var(--green);
  background: #f2f8ed;
}

.vehicle-visual {
  width: 64px;
  height: 56px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf0ea;
}

.vehicle-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-card strong,
.vehicle-card small {
  display: block;
}

.vehicle-card small {
  margin-top: 4px;
  color: var(--muted);
}

.vehicle-card b {
  white-space: nowrap;
}

.fare-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9faf6;
}

.fare-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.fare-box span {
  color: var(--muted);
}

.request-button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
}

.request-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.status-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 76px;
  border-radius: 8px;
  padding: 14px;
  background: #f2f8ed;
}

.status-pulse {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.1s infinite;
}

.status-card p {
  font-weight: 900;
}

.status-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.insight-panel,
.module-panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel {
  max-width: 520px;
}

.insight-panel {
  padding: 22px;
}

.insight-panel h2,
.module-panel h2,
.module-panel h3 {
  margin: 0;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 900;
}

.share-layout,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.module-panel {
  padding: 20px;
}

.muted {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.match-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.match-card.active {
  border-color: var(--green);
  background: #f2f8ed;
}

.match-score {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--lime);
  font-weight: 900;
}

.match-card strong,
.match-card small {
  display: block;
}

.match-card small {
  margin-top: 4px;
  color: var(--muted);
}

.share-rules {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.share-rules label {
  display: flex;
  gap: 10px;
  align-items: center;
}

.share-rules input {
  accent-color: var(--green);
}

.flow-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.flow-list span {
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfa;
  font-weight: 800;
}

.metric-card {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: 32px;
}

.wide {
  grid-column: span 2;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.admin-select {
  min-height: 38px;
  max-width: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #ffffff;
}

.small-action {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f2f8ed;
  color: var(--green);
  font-weight: 900;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(20, 107, 67, 0.42);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(20, 107, 67, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(20, 107, 67, 0);
  }
}

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

  .side-nav {
    position: static;
  }

  .company-card {
    margin-top: 0;
  }

  #clientView.active,
  .share-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .workspace,
  .side-nav {
    padding: 16px;
  }

  .top-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .phone-frame {
    border-width: 6px;
    border-radius: 18px;
  }

  .map-stage {
    min-height: 310px;
  }

  .vehicle-card {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  .vehicle-visual {
    width: 56px;
    height: 52px;
  }

  .match-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .match-card button {
    grid-column: 1 / -1;
  }
}
