: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;
}

[hidden] {
  display: none !important;
}

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

.driver-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  background: var(--ink);
  color: #ffffff;
}

.driver-hero h1 {
  margin: auto 0 0;
  max-width: 11ch;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

.driver-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.driver-workspace {
  display: grid;
  align-content: start;
}

.driver-dashboard {
  display: grid;
  gap: 18px;
}

.driver-dashboard [hidden] {
  display: none;
}

.driver-section-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.driver-section-nav button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.driver-section-nav button.active {
  background: var(--ink);
  color: #ffffff;
}

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

.driver-trip-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfa;
}

.driver-trip-card strong,
.driver-trip-card span {
  display: block;
}

.driver-trip-card span {
  margin-top: 4px;
  color: var(--muted);
}

.driver-trip-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.driver-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.driver-history-summary .metric-card {
  box-shadow: none;
}

.driver-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.driver-history-row strong,
.driver-history-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.driver-history-row span {
  color: var(--muted);
}

.driver-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.driver-navigation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.waze-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #0b8f66;
  border-radius: 8px;
  padding: 0 12px;
  background: #e8f7ef;
  color: #07563e;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.driver-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.driver-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.driver-auth-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.driver-auth-tabs button.active {
  border-color: var(--green);
  background: #f2f8ed;
  color: var(--green);
}

.company-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
}

.application-result {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  border: 1px solid #b7d8c6;
  border-radius: 8px;
  padding: 12px;
  background: #f2f8ed;
}

.application-result span,
.application-result strong {
  display: block;
}

.driver-apply-form input[type="file"] {
  min-height: auto;
  padding: 12px;
  background: #ffffff;
}

.driver-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 150px));
  gap: 10px;
  align-items: start;
  justify-content: start;
}

.driver-doc-grid a {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.driver-doc-grid img {
  width: 100%;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.driver-doc-card {
  display: grid;
  gap: 8px;
  align-content: start;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.doc-review-select {
  max-width: none;
  width: 100%;
}

.doc-note-input {
  min-height: 34px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.client-driver-photo {
  width: 46px;
  height: 46px;
  border: 2px solid #ffffff;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(16, 21, 18, 0.18);
}

.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: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  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;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.report-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 220px));
  gap: 10px;
  align-items: end;
}

.report-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-controls input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
}

.compact-button {
  min-height: 42px;
}

#printReport {
  display: none;
}

.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-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.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;
}

.tracking-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfa;
}

.tracking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tracking-head span,
.tracking-details dt {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tracking-head strong {
  display: block;
  margin-top: 4px;
}

.tracking-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.tracking-progress span {
  height: 8px;
  border-radius: 8px;
  background: var(--line);
}

.tracking-progress span.active {
  background: var(--lime);
}

.tracking-progress span.cancelled {
  background: var(--coral);
}

.tracking-timeline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tracking-timeline li {
  border-left: 4px solid var(--line);
  padding: 8px 0 8px 12px;
  color: var(--muted);
  font-weight: 800;
}

.tracking-timeline li.active {
  border-left-color: var(--green);
  color: var(--ink);
}

.tracking-timeline li.current {
  background: #f2f8ed;
}

.tracking-timeline li.cancelled {
  border-left-color: var(--coral);
  color: var(--coral);
}

.tracking-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.tracking-details div {
  display: grid;
  gap: 3px;
}

.tracking-details dd {
  margin: 0;
}

#trackingDriver {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tracking-call {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.tracking-actions {
  display: grid;
  gap: 8px;
}

.receipt-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.live-map-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.live-ride-map {
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4ef;
}

.receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receipt-head span,
.receipt-details dt {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.receipt-head strong {
  display: block;
  margin-top: 4px;
}

.receipt-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.receipt-details div {
  display: grid;
  gap: 3px;
}

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

.receipt-company {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.receipt-company span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.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;
}

.admin-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.admin-grid [hidden] {
  display: none;
}

.module-panel {
  padding: 16px;
}

.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;
}

.active-driver-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.active-driver-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.active-driver-card strong,
.active-driver-card span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.active-driver-card span {
  color: var(--muted);
}

.active-driver-card .status-pill {
  justify-self: start;
  color: var(--green);
}

.driver-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.driver-stat-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #f8fbfa;
  color: var(--muted);
  white-space: nowrap;
  overflow-wrap: normal;
}

.driver-stat-strip b {
  color: var(--ink);
}

.driver-empty-state {
  display: block;
}

.driver-review-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfa;
}

.driver-review-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.driver-review-head strong,
.driver-review-head small {
  display: block;
}

.driver-review-head small {
  margin-top: 4px;
  color: var(--muted);
}

.compliance-list {
  display: grid;
  gap: 8px;
}

.fleet-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.fleet-mini-grid span,
.fleet-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.fleet-summary {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.fleet-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(5, minmax(100px, 1fr));
  align-items: center;
  gap: 10px;
}

.fleet-row strong,
.fleet-row span {
  display: block;
}

.fleet-row span {
  color: var(--muted);
}

.fleet-management-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(86px, auto) minmax(86px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.fleet-management-main,
.fleet-management-actions {
  min-width: 0;
}

.fleet-management-row strong,
.fleet-management-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.fleet-management-row span {
  color: var(--muted);
}

.fleet-management-row .status-pill {
  justify-self: start;
  color: var(--green);
}

.fleet-management-actions {
  justify-self: end;
}

.fleet-management-actions .small-action {
  min-width: 78px;
}

.fleet-km-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(110px, 1fr));
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.fleet-km-row strong,
.fleet-km-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.fleet-km-row span {
  color: var(--muted);
}

.compliance-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

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

.compliance-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.metric-card {
  display: grid;
  gap: 4px;
  padding: 14px;
}

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

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

.wide {
  grid-column: span 4;
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-form .request-button {
  align-self: end;
}

.compact-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-summary {
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.finance-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.period-buttons,
.finance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.period-buttons .ghost-button {
  min-height: 36px;
}

.period-buttons .ghost-button.active {
  background: var(--ink);
  color: #ffffff;
}

.finance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.finance-kpi-grid .metric-card {
  box-shadow: none;
}

.section-subtitle {
  margin: 20px 0 0;
}

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

table {
  width: 100%;
  min-width: 920px;
  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;
}

.small-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.danger-action {
  background: #8f1d1d;
}

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

.fleet-console {
  min-height: 100vh;
  background: #ffffff;
  color: var(--ink);
}

.fleet-console [hidden] {
  display: none !important;
}

.fleet-appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 58px;
  border-bottom: 1px solid #dbe3dd;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.fleet-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0d1510;
  text-decoration: none;
}

.fleet-brand img {
  width: 30px;
  height: 30px;
}

.fleet-brand strong {
  font-size: 22px;
  letter-spacing: 0;
}

.fleet-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.fleet-nav a,
.fleet-nav button {
  position: relative;
  border: 0;
  padding: 20px 14px 18px;
  background: transparent;
  color: #4d5851;
  font-weight: 850;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.fleet-nav a.active,
.fleet-nav button.active {
  color: #0d1510;
}

.fleet-nav a.active::after,
.fleet-nav button.active::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: #1f8f5f;
}

.fleet-app-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fleet-round-action,
.fleet-icon-action {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.fleet-round-action {
  background: #21895f;
  color: #ffffff;
  font-size: 22px;
}

.fleet-icon-action {
  background: #edf2ef;
  color: #18201a;
}

.fleet-company {
  color: #4d5851;
  font-weight: 850;
  white-space: nowrap;
}

.fleet-login-wrap {
  display: grid;
  min-height: calc(100vh - 58px);
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.18)),
    repeating-linear-gradient(28deg, transparent 0 54px, rgba(31, 143, 95, 0.08) 55px 58px),
    #e8efe9;
}

.clean-fleet .fleet-login-wrap {
  background: #ffffff;
}

.fleet-dashboard {
  display: grid;
  gap: 18px;
  padding: 24px;
  background: #ffffff;
}

.fleet-dashboard-head,
.fleet-card {
  border: 1px solid #dbe3dd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(21, 31, 24, 0.07);
}

.fleet-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.fleet-dashboard-head h1 {
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.fleet-dashboard-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.fleet-card {
  padding: 18px;
}

.fleet-tab-panel {
  display: none;
  gap: 18px;
}

.fleet-tab-panel.active {
  display: grid;
}

.fleet-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.fleet-map-shell {
  position: relative;
  min-height: calc(100vh - 58px);
  overflow: hidden;
  padding: 24px;
}

.fleet-map-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(226, 242, 233, 0.72) 0 16%, transparent 16% 100%),
    repeating-linear-gradient(0deg, rgba(170, 185, 178, 0.2) 0 1px, transparent 1px 86px),
    repeating-linear-gradient(90deg, rgba(170, 185, 178, 0.18) 0 1px, transparent 1px 112px),
    #f7faf8;
}

.fleet-map-visual::before,
.fleet-map-visual::after {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    linear-gradient(29deg, transparent 0 37%, rgba(199, 209, 203, 0.8) 37% 38.5%, transparent 38.5% 100%),
    linear-gradient(148deg, transparent 0 52%, rgba(199, 209, 203, 0.72) 52% 53.2%, transparent 53.2% 100%);
}

.fleet-map-visual::after {
  transform: rotate(-8deg) scale(1.05);
  opacity: 0.8;
}

.road {
  position: absolute;
  z-index: 1;
  height: 10px;
  border-radius: 999px;
  background: #d4ded8;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.road-a {
  top: 35%;
  left: 22%;
  width: 62%;
  transform: rotate(12deg);
}

.road-b {
  top: 62%;
  left: 12%;
  width: 56%;
  transform: rotate(-18deg);
}

.road-c {
  top: 18%;
  right: -6%;
  width: 44%;
  transform: rotate(78deg);
}

.road-d {
  right: 18%;
  bottom: 14%;
  width: 40%;
  transform: rotate(4deg);
}

.district,
.map-pin {
  position: absolute;
  z-index: 2;
}

.district {
  color: rgba(62, 74, 66, 0.58);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.district-a {
  top: 18%;
  left: 55%;
}

.district-b {
  bottom: 18%;
  left: 43%;
}

.district-c {
  top: 43%;
  right: 19%;
}

.map-pin {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #1f8f5f;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 31, 22, 0.22);
  font-size: 11px;
  font-weight: 900;
}

.pin-a {
  top: 42%;
  left: 56%;
}

.pin-b {
  top: 25%;
  right: 13%;
}

.pin-c {
  right: 31%;
  bottom: 26%;
}

.fleet-operations-panel {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 14px;
  width: min(470px, calc(100vw - 48px));
  max-height: calc(100vh - 106px);
  overflow-y: auto;
  border: 1px solid rgba(216, 226, 219, 0.92);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 45px rgba(21, 31, 24, 0.18);
}

.fleet-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.fleet-panel-head h1 {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.fleet-panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.fleet-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1f7d56;
  font-size: 13px;
  font-weight: 900;
}

.fleet-live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1f8f5f;
}

.fleet-close-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #eef3ef;
  color: #18201a;
  font-size: 24px;
}

.fleet-quick-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.fleet-period-card,
.fleet-panel-section {
  border-top: 1px solid #e3eae5;
  padding-top: 14px;
}

.fleet-period-card h2,
.fleet-section-title h2 {
  margin: 0;
  font-size: 16px;
}

.fleet-period-card .report-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

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

.finance-grid {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.fleet-kpi-grid .metric-card {
  box-shadow: none;
  padding: 12px;
}

.fleet-kpi-grid .metric-card strong {
  font-size: 22px;
  line-height: 1.1;
}

.fleet-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fleet-section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.fleet-operations-panel .fleet-summary {
  margin-top: 10px;
}

.fleet-operations-panel .fleet-row {
  grid-template-columns: minmax(150px, 1fr) minmax(72px, auto);
}

.fleet-report-dock {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  width: min(760px, calc(100vw - 548px));
  max-height: 42vh;
  overflow: hidden;
  border: 1px solid rgba(216, 226, 219, 0.92);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 45px rgba(21, 31, 24, 0.16);
}

.fleet-report-dock .table-wrap {
  max-height: 30vh;
  overflow: auto;
}

.fleet-settings-anchor {
  position: absolute;
  right: 0;
  bottom: 0;
}

@media print {
  body > *:not(#printReport) {
    display: none !important;
  }

  #printReport {
    display: block;
    color: #18201a;
    font-family: Arial, sans-serif;
    margin: 0;
  }

  #printReport h1 {
    font-size: 24px;
    margin: 0 0 6px;
  }

  #printReport p {
    margin: 4px 0;
  }

  #printReport .muted {
    color: #66706a;
  }

  #printReport .summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 22px 0;
  }

  #printReport .card {
    border: 1px solid #d9e0da;
    border-radius: 8px;
    padding: 10px;
  }

  #printReport .card span {
    color: #66706a;
    display: block;
    font-size: 12px;
  }

  #printReport .card strong {
    display: block;
    font-size: 18px;
    margin-top: 4px;
  }

  #printReport table {
    border-collapse: collapse;
    font-size: 11px;
    min-width: 0;
    width: 100%;
  }

  #printReport th,
  #printReport td {
    border-bottom: 1px solid #d9e0da;
    padding: 7px 5px;
    text-align: left;
    vertical-align: top;
  }

  #printReport th {
    color: #66706a;
  }
}

@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;
  }

  .driver-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
  }

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

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

  .fleet-management-row {
    grid-template-columns: 1fr;
  }

  .fleet-km-row {
    grid-template-columns: 1fr;
  }

  .fleet-management-actions {
    justify-self: stretch;
  }

  .fleet-management-actions .small-action {
    width: 100%;
  }

  .finance-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-kpi-grid {
    grid-template-columns: 1fr;
  }

  .driver-history-summary,
  .driver-history-row {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .fleet-appbar {
    grid-template-columns: 1fr auto;
  }

  .fleet-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .fleet-map-shell {
    overflow: visible;
  }

  .fleet-operations-panel,
  .fleet-report-dock {
    position: relative;
    right: auto;
    bottom: auto;
    width: auto;
    max-height: none;
  }

  .fleet-report-dock {
    margin-top: 18px;
  }
}

@media (max-width: 620px) {
  .driver-navigation-actions {
    grid-template-columns: 1fr;
  }

  .workspace,
  .side-nav {
    padding: 16px;
  }

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

  .report-controls {
    grid-template-columns: 1fr;
  }

  .fleet-appbar {
    gap: 10px;
    padding: 10px 12px;
  }

  .fleet-brand strong {
    font-size: 20px;
  }

  .fleet-app-actions {
    gap: 6px;
  }

  .fleet-company {
    display: none;
  }

  .fleet-map-shell {
    padding: 12px;
  }

  .fleet-map-visual {
    display: none;
  }

  .fleet-operations-panel,
  .fleet-report-dock {
    width: 100%;
  }

  .fleet-kpi-grid,
  .fleet-period-card .report-controls {
    grid-template-columns: 1fr 1fr;
  }

  .fleet-dashboard {
    padding: 12px;
  }

  .fleet-dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .fleet-quick-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .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;
  }
}
