:root {
  --bg: #101419;
  --panel: #f7f8fb;
  --ink: #111827;
  --muted: #64748b;
  --line: #d9e0ea;
  --green: #18a058;
  --blue: #2563eb;
  --yellow: #d99a00;
  --purple: #7c3aed;
  --red: #dc2626;
  --gray: #6b7280;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(16, 24, 40, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

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

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
  background: var(--ink);
  color: var(--white);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
  color: var(--ink);
}

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

.map-pane {
  min-height: 100vh;
  position: relative;
  background: #dfe7ef;
}

.map {
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

.map-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(17, 24, 39, 0.06) 1px, transparent 1px),
    #e8eef5;
  background-size: 44px 44px;
}

.control-pane {
  height: 100vh;
  overflow: auto;
  background: var(--panel);
  padding: 22px;
}

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

.brand {
  display: grid;
  gap: 2px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
}

.brand span {
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.stack {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
  background: #eef2f7;
  color: var(--muted);
}

.status-activo,
.status-esperando_taxi,
.status-disponible {
  background: rgba(24, 160, 88, 0.13);
  color: #137544;
}

.status-en_solicitud,
.status-pendiente {
  background: rgba(217, 154, 0, 0.16);
  color: #876000;
}

.status-en_llamada {
  background: rgba(37, 99, 235, 0.14);
  color: #1e40af;
}

.status-servicio_aceptado,
.status-en_servicio {
  background: rgba(124, 58, 237, 0.14);
  color: #5b21b6;
}

.status-rechazada,
.status-inactivo,
.status-bloqueado {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.primary {
  background: var(--green);
}

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

.purple {
  background: var(--purple);
}

.danger {
  background: var(--red);
}

.ghost {
  background: #edf1f7;
  color: var(--ink);
}

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

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.item strong {
  display: block;
  margin-bottom: 4px;
}

.marker-dot {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.marker-user {
  background: var(--green);
}

.marker-taxi {
  background: var(--blue);
}

.marker-busy {
  background: var(--purple);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
}

.modal.is-open {
  display: flex;
}

.modal-panel {
  width: min(460px, 100%);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.modal-panel h2 {
  margin: 0 0 8px;
}

.qr-box {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fafafa;
}

.qr-box img {
  width: 220px;
  height: 220px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

audio {
  width: 100%;
}

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

  .map-pane,
  .map {
    min-height: 50vh;
    height: 50vh;
  }

  .control-pane {
    height: 50vh;
    padding: 16px;
  }

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

  .brand h1 {
    font-size: 21px;
  }
}
