:root {
  --ink: #17201d;
  --muted: #63706a;
  --line: #d7e0dc;
  --surface: #ffffff;
  --wash: #f3f7f4;
  --green: #0f766e;
  --green-dark: #0b4f4a;
  --gold: #e6a93a;
  --blue: #3157a4;
  --red: #be3b35;
  --shadow: 0 18px 42px rgba(23, 32, 29, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.05) 1px, transparent 1px),
    #eef3ef;
  background-size: 34px 34px;
}

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

button {
  cursor: pointer;
}

h2,
p {
  margin-block-start: 0;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

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

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.role-tabs,
.filter-group {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}

.tab-button,
.filter-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  padding: 8px 12px;
}

.tab-button.active,
.filter-button.active {
  color: #fff;
  background: var(--green);
}

.status-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.language-picker {
  min-width: 138px;
  gap: 4px;
}

.language-picker span {
  color: var(--muted);
  font-size: 0.74rem;
}

.language-picker select {
  min-height: 38px;
  padding: 7px 10px;
}

.install-action {
  min-height: 38px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 7px;
  color: var(--green-dark);
  background: rgba(15, 118, 110, 0.08);
  padding: 8px 12px;
  font-weight: 900;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(230, 169, 58, 0.18);
}

.workspace {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 2.6vw, 30px);
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
}

.left-panel,
.board-section,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.left-panel {
  align-self: start;
}

.tab-panel {
  display: none;
  padding: 20px;
}

.tab-panel.active {
  display: grid;
  gap: 18px;
}

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

.panel-heading p {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 900;
}

.panel-heading span,
.inline-status,
.market-toolbar span,
.board-heading span,
.card-kicker,
.market-card small,
.subscription-card p,
.voice-tools span,
.location-tools span {
  color: var(--muted);
}

.stacked-form,
.subscription-card,
.session-card,
.rider-flow-card,
.notice-panel,
.admin-account-actions {
  display: grid;
  gap: 13px;
}

.stacked-form h2,
.subscription-card h2,
.session-card h2,
.rider-flow-card h2,
.notice-panel h2,
.board-heading h2 {
  margin: 0;
  font-size: 1rem;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

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

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

.flow-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #a7b4ac;
}

.flow-step.complete .flow-dot,
.flow-step.current .flow-dot {
  background: var(--green);
}

.flow-step.locked .flow-dot {
  background: var(--red);
}

.flow-step strong,
.flow-step small {
  display: block;
}

.flow-step small {
  color: var(--muted);
  line-height: 1.35;
}

.flow-badge {
  justify-self: end;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--wash);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: capitalize;
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

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

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.primary-action {
  color: #fff;
  background: var(--green);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--green-dark);
}

.secondary-action {
  color: var(--green-dark);
  background: rgba(15, 118, 110, 0.09);
  border-color: rgba(15, 118, 110, 0.25);
}

.ghost-action {
  color: var(--green-dark);
  background: #fff;
  border-color: var(--line);
}

.ghost-action.danger,
.decline-rider {
  color: var(--red);
  border-color: rgba(190, 59, 53, 0.28);
}

.primary-action:disabled,
.secondary-action:disabled,
.ghost-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.inline-status {
  min-height: 22px;
  margin: -4px 0 0;
  font-size: 0.9rem;
}

.security-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.voice-tools,
.location-tools,
.subscription-card,
.session-card,
.notice-panel,
.admin-account-actions {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
}

.compact-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.session-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.session-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.voice-tools,
.location-tools {
  display: grid;
  gap: 10px;
}

.voice-tools > div:first-child,
.location-tools > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.voice-buttons,
.location-buttons,
.admin-actions,
.review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ride-guidance {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
}

.ride-guidance > div:first-child {
  display: grid;
  gap: 3px;
}

.ride-guidance span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.ride-action-slot {
  display: grid;
  gap: 10px;
}

.ride-action-slot:empty {
  display: none;
}

.admin-directory-tools,
.production-checks,
.fare-boost-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.production-checks h2 {
  margin: 0;
  font-size: 1rem;
}

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

.production-check-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  background: var(--wash);
}

.production-check-item strong {
  color: var(--ink);
}

.production-check-item small {
  color: var(--muted);
  line-height: 1.4;
}

.production-check-summary {
  background: #f8fafc;
}

.production-check-ok {
  border-left-color: #1b8f62;
}

.production-check-warn {
  border-left-color: #c67817;
}

.production-check-block {
  border-left-color: #b42318;
  background: #fff7f5;
}

.translation-coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.translation-coverage-pill {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.translation-coverage-pill small {
  font-size: 0.78rem;
}

.translation-ready {
  border-left: 3px solid #1b8f62;
}

.translation-partial {
  border-left: 3px solid #c67817;
}

.directory-region-heading {
  display: grid;
  gap: 3px;
  padding: 10px 2px 4px;
  color: var(--muted);
}

.directory-region-heading strong {
  color: var(--ink);
}

.directory-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}

.directory-pagination span {
  color: var(--muted);
  font-size: 0.9rem;
}

.notice-list {
  display: grid;
  gap: 9px;
}

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

.notice-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

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

.metric-grid div {
  display: grid;
  gap: 4px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
}

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

.metric-grid strong {
  font-size: 1.5rem;
}

.market-panel {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.market-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

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

.market-refresh {
  min-width: 138px;
}

.market-toolbar span,
.market-toolbar strong {
  display: block;
}

.market-toolbar span {
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.market-toolbar strong {
  font-size: clamp(1.1rem, 2vw, 1.58rem);
}

.city-map {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border: 1px solid #b7d6cf;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.58) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.58) 1px, transparent 1px),
    linear-gradient(135deg, #d8ecd6 0%, #ecf0d7 50%, #d6e7ee 100%);
  background-size: 40px 40px, 40px 40px, auto;
  box-shadow: var(--shadow);
}

.road {
  position: absolute;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 1px rgba(67, 88, 79, 0.14);
  transform-origin: left center;
}

.road-one {
  width: 82%;
  left: 7%;
  top: 48%;
  transform: rotate(-9deg);
}

.road-two {
  width: 56%;
  left: 25%;
  top: 66%;
  transform: rotate(27deg);
}

.road-three {
  width: 46%;
  left: 55%;
  top: 30%;
  transform: rotate(63deg);
}

.district {
  position: absolute;
  color: rgba(23, 32, 29, 0.56);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.district-north {
  left: 14%;
  top: 17%;
}

.district-market {
  left: 43%;
  top: 50%;
}

.district-center {
  right: 21%;
  top: 38%;
}

.district-south {
  right: 12%;
  bottom: 17%;
}

.map-pin {
  position: absolute;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 8px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 10px 22px rgba(23, 32, 29, 0.25);
  transform: translate(-50%, -100%) rotate(-45deg);
  font-size: 0.72rem;
  font-weight: 900;
}

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

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

.pin-rider {
  background: var(--gold);
  color: #1f211a;
}

.pin-selected {
  background: var(--green);
}

.board-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr 0.92fr;
  gap: 14px;
  align-items: start;
}

.board-grid.role-passenger,
.board-grid.role-rider {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.board-grid.role-admin {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.board-grid.role-admin .admin-detail-board {
  grid-column: 1 / -1;
}

.board-section,
.chat-panel {
  padding: 14px;
}

.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

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

.market-card.selected {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.card-select {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.market-card strong,
.market-card small,
.card-select strong,
.card-select small,
.card-kicker {
  display: block;
}

.market-card strong,
.card-select strong {
  margin: 2px 0;
}

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

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-row span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--wash);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.detail-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
}

.detail-row span,
.detail-list span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.detail-row strong,
.detail-list strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

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

.detail-list article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-detail-board .market-card {
  gap: 14px;
}

.empty-state {
  min-height: 98px;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #b8c5bd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.chat-panel {
  display: grid;
  gap: 10px;
}

.chat-thread {
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
}

.chat-bubble {
  width: fit-content;
  max-width: min(560px, 88%);
  padding: 9px 11px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.chat-bubble.self {
  justify-self: end;
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

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

.safety-report-form {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1160px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .board-grid {
    grid-template-columns: 1fr 1fr;
  }

  .board-grid.role-admin {
    grid-template-columns: 1fr;
  }

  .board-grid .board-section:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .status-pill {
    justify-self: start;
  }

  .install-action {
    width: 100%;
  }

  .language-picker {
    width: 100%;
  }

  .role-tabs,
  .market-actions,
  .filter-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

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

  .field-row,
  .detail-grid,
  .verification-row,
  .metric-grid,
  .board-grid,
  .chat-form {
    grid-template-columns: 1fr;
  }

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

  .voice-buttons,
  .admin-actions,
  .review-actions {
    flex-direction: column;
  }
}
