/* ==========================================================================
   FixGo · Design system
   Mobile-first, dark premium, glassmorphism + skeleton loaders
   ========================================================================== */

:root {
  /* Base */
  --bg: #060912;
  --bg-2: #0a0f1d;
  --surface: #101827;
  --surface-2: #16203347;
  --surface-solid: #162033;
  --line: #223049;
  --line-soft: #1a2438;

  /* Texto */
  --text: #eef2fb;
  --muted: #93a1bd;
  --muted-2: #64748b;

  /* Marca */
  --primary: #4f7bff;
  --primary-2: #7b5cff;
  --accent: #00e5a0;
  --warn: #ffb020;
  --danger: #ff5c5c;
  --info: #38bdf8;

  --grad-brand: linear-gradient(135deg, #4f7bff 0%, #7b5cff 55%, #b14cff 100%);
  --grad-mint: linear-gradient(135deg, #00e5a0 0%, #22d3ee 100%);
  --grad-surface: linear-gradient(160deg, #131c2e 0%, #0d1421 100%);

  /* Formas */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --pill: 999px;

  /* Sombras */
  --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --sh: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --sh-lg: 0 26px 60px -22px rgba(0, 0, 0, 0.75);
  --glow: 0 0 0 1px rgba(79, 123, 255, 0.25), 0 12px 40px -12px rgba(79, 123, 255, 0.55);

  /* Movimiento */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.16s var(--ease);
  --t: 0.28s var(--ease);
  --t-slow: 0.5s var(--ease);

  /* Layout */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar: 74px;
  --maxw: 520px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 12% -8%, rgba(79, 123, 255, 0.16), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(123, 92, 255, 0.14), transparent 60%),
    radial-gradient(700px 500px at 50% 108%, rgba(0, 229, 160, 0.07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h1 { font-size: 28px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(79, 123, 255, 0.35); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--pill);
}
::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --------------------------- Utilidades -------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hidden { display: none !important; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-between: 16px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.ok-text { color: var(--accent); }
.tiny { font-size: 11.5px; }
.small { font-size: 13px; }
.bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -0.01em; }

/* ------------------------------ Botones -------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 20px;
  min-height: 48px;
  border-radius: var(--r);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t), background var(--t), opacity var(--t);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.is-loading { opacity: 0.55; pointer-events: none; }
.btn svg { width: 19px; height: 19px; flex: none; }

.btn-primary {
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: var(--glow);
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 55%);
  pointer-events: none;
}
.btn-mint {
  background: var(--grad-mint);
  color: #04231a;
  border-color: transparent;
  box-shadow: 0 12px 34px -14px rgba(0, 229, 160, 0.7);
}
.btn-ghost { background: transparent; }
.btn-soft {
  background: rgba(79, 123, 255, 0.12);
  border-color: rgba(79, 123, 255, 0.28);
  color: #cddcff;
}
.btn-danger {
  background: rgba(255, 92, 92, 0.13);
  border-color: rgba(255, 92, 92, 0.35);
  color: #ffb4b4;
}
.btn-ok {
  background: rgba(0, 229, 160, 0.14);
  border-color: rgba(0, 229, 160, 0.35);
  color: #8bffd4;
}
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 13.5px; border-radius: 12px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { min-height: 56px; font-size: 16.5px; border-radius: var(--r-lg); }
.btn-icon { padding: 0; width: 44px; min-height: 44px; border-radius: 14px; }

/* Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  animation: ripple 0.6s var(--ease) forwards;
}
@keyframes ripple {
  to { transform: scale(2.6); opacity: 0; }
}

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------- Cards --------------------------------- */
.card {
  position: relative;
  background: var(--grad-surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--sh);
}
.card-glass {
  background: rgba(19, 28, 46, 0.66);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.card-tight { padding: 14px; }
.card-hover { transition: transform var(--t), border-color var(--t); }
.card-hover:active { transform: scale(0.99); }
.card-hover:hover { border-color: var(--line); }

/* ------------------------- Secciones / titulos ------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow::before {
  content: '';
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
}
.section-title { font-size: 19px; margin-bottom: 4px; }

/* ------------------------------ Badges --------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}
.badge-buscando  { color: #ffd27a; background: rgba(255,176,32,.13); border-color: rgba(255,176,32,.32); }
.badge-aceptada  { color: #9ec0ff; background: rgba(79,123,255,.14); border-color: rgba(79,123,255,.34); }
.badge-en_camino { color: #7fe6ff; background: rgba(56,189,248,.14); border-color: rgba(56,189,248,.34); }
.badge-en_servicio { color: #8bffd4; background: rgba(0,229,160,.13); border-color: rgba(0,229,160,.32); }
.badge-completada { color: #9fe8c0; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); }
.badge-cancelada { color: #ffb4b4; background: rgba(255,92,92,.12); border-color: rgba(255,92,92,.3); }
.badge-neutral { color: var(--muted); background: rgba(148,163,184,.12); border-color: rgba(148,163,184,.25); }
.badge-live {
  color: #8bffd4;
  background: rgba(0,229,160,.1);
  border-color: rgba(0,229,160,.3);
}
.badge-live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.4s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,229,160,.6); }
  50% { opacity: .5; box-shadow: 0 0 0 6px rgba(0,229,160,0); }
}

/* ------------------------------ Avatares -------------------------------- */
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  font-weight: 750;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.02em;
  background: var(--grad-brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  text-transform: uppercase;
}
.avatar-sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar-lg { width: 60px; height: 60px; font-size: 21px; }
.avatar-xl { width: 84px; height: 84px; font-size: 28px; }
.avatar-online::after {
  content: '';
  position: absolute;
  right: -1px; bottom: -1px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #0d1421;
  box-shadow: 0 0 10px rgba(0, 229, 160, 0.8);
}
.avatar-ring {
  box-shadow: 0 0 0 3px rgba(79, 123, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ------------------------------- Chips --------------------------------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-scroll {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 4px 0 8px;
  margin: 0 -18px;
  padding-inline: 18px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chips-scroll::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all var(--t-fast);
  scroll-snap-align: start;
}
.chip svg { width: 16px; height: 16px; }
.chip:active { transform: scale(0.96); }
.chip.is-active {
  color: #fff;
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: 0 8px 22px -10px rgba(79, 123, 255, 0.8);
}

/* ------------------------------ Formulario ----------------------------- */
.field { margin-bottom: 16px; }
.label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.input,
.textarea,
.select {
  width: 100%;
  padding: 14px 15px;
  min-height: 50px;
  border-radius: var(--r);
  background: rgba(6, 11, 20, 0.62);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(79, 123, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(79, 123, 255, 0.14);
}
.textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a1bd' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 17px;
  padding-right: 42px;
}
.select option { background: #101827; color: var(--text); }
.field-error .input, .field-error .textarea, .field-error .select { border-color: var(--danger); }
.error-msg {
  display: none;
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ff9d9d;
}
.field-error .error-msg { display: block; }
.hint { margin-top: 7px; font-size: 12px; color: var(--muted-2); }

.input-group { position: relative; }
.input-group .input { padding-left: 46px; }
.input-icon {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  width: 19px; height: 19px;
  color: var(--muted-2);
  pointer-events: none;
}

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative;
  width: 52px; height: 30px;
  flex: none;
  border-radius: var(--pill);
  background: rgba(148, 163, 184, 0.22);
  border: 1px solid var(--line);
  transition: background var(--t), border-color var(--t);
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-sm);
  transition: transform var(--t);
}
.switch input:checked + .switch-track {
  background: var(--grad-mint);
  border-color: transparent;
}
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Checkbox / radio custom */
.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.check input { position: absolute; opacity: 0; }
.check-box {
  width: 21px; height: 21px;
  flex: none;
  margin-top: 1px;
  border-radius: 7px;
  border: 1.8px solid var(--line);
  background: rgba(6, 11, 20, 0.6);
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
}
.check-box::after {
  content: '';
  width: 10px; height: 6px;
  border: 2.2px solid #fff;
  border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0);
  transition: transform var(--t-fast);
  margin-top: -2px;
}
.check input:checked + .check-box {
  background: var(--grad-brand);
  border-color: transparent;
}
.check input:checked + .check-box::after { transform: rotate(-45deg) scale(1); }

/* Estrellas */
.stars { display: inline-flex; gap: 4px; }
.stars svg { width: 17px; height: 17px; color: var(--line); transition: color var(--t-fast); }
.stars button svg { transition: transform var(--t-fast); }
.stars button:active svg { transform: scale(1.25); }
.stars svg.on { color: #ffc531; fill: #ffc531; }
.stars.rate svg { width: 38px; height: 38px; }
.stars.rate svg { cursor: pointer; }

/* ----------------------------- Skeletons ------------------------------- */
.sk {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
}
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.075),
    transparent
  );
  animation: shimmer 1.35s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
.sk-line { height: 12px; margin-bottom: 9px; }
.sk-line.sm { width: 45%; }
.sk-line.md { width: 70%; }
.sk-line.lg { width: 100%; height: 16px; }
.sk-avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; }
.sk-block { height: 84px; border-radius: var(--r); }
.sk-card { height: 128px; border-radius: var(--r-lg); }
.sk-media { height: 168px; border-radius: var(--r-lg); }

.sk-list-item { display: flex; gap: 13px; align-items: center; }
.sk-stack { display: grid; gap: 7px; flex: 1; }

/* Spinner de pagina */
.page-loader {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 60px 0;
}
.page-loader .spinner {
  width: 34px; height: 34px;
  border-width: 3px;
  border-color: var(--line);
  border-top-color: var(--primary);
}

/* ------------------------------- Toasts -------------------------------- */
#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + var(--safe-b) + 18px);
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(calc(100vw - 28px), var(--maxw));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r);
  background: rgba(16, 24, 39, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  font-size: 14px;
  font-weight: 550;
  animation: toast-in 0.34s var(--ease);
  pointer-events: auto;
}
.toast.out { animation: toast-out 0.26s var(--ease) forwards; }
.toast svg { width: 19px; height: 19px; flex: none; }
.toast-ok { border-color: rgba(0, 229, 160, 0.4); }
.toast-ok svg { color: var(--accent); }
.toast-error { border-color: rgba(255, 92, 92, 0.42); }
.toast-error svg { color: var(--danger); }
.toast-info svg { color: var(--info); }
.toast-warn { border-color: rgba(255, 176, 32, 0.42); }
.toast-warn svg { color: var(--warn); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

/* --------------------------- Sheet / Modal ----------------------------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(3, 6, 13, 0.72);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity var(--t);
}
.scrim.show { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 901;
  max-width: var(--maxw);
  margin: 0 auto;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #16203347 0%, #0d1524 8%), #0d1524;
  background-color: #0d1524;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-lg);
  transform: translateY(102%);
  transition: transform 0.36s var(--ease);
  padding-bottom: var(--safe-b);
}
.sheet.show { transform: translateY(0); }
.sheet-grip {
  width: 40px; height: 4px;
  border-radius: var(--pill);
  background: var(--line);
  margin: 11px auto 4px;
  flex: none;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 14px;
  flex: none;
}
.sheet-body {
  padding: 0 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.sheet-foot {
  padding: 14px 20px calc(16px + var(--safe-b));
  border-top: 1px solid var(--line-soft);
  background: rgba(6, 11, 20, 0.5);
  flex: none;
  display: grid;
  gap: 9px;
}

/* Modal centrado (SweetAlert usa el suyo, esto es para confirmaciones propias) */
.modal-card { animation: pop-in 0.32s var(--ease); }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9) translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------- Lista vacia ------------------------------ */
.empty {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(79, 123, 255, 0.09);
  border: 1px solid rgba(79, 123, 255, 0.18);
  color: var(--primary);
}
.empty-icon svg { width: 32px; height: 32px; }
.empty h3 { color: var(--text); }
.empty p { color: var(--muted); font-size: 14px; max-width: 32ch; }

/* --------------------------- Elementos lista --------------------------- */
.item {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 14px;
  border-radius: var(--r);
  background: var(--grad-surface);
  border: 1px solid var(--line-soft);
  transition: border-color var(--t), transform var(--t-fast);
  text-align: left;
  width: 100%;
}
.item:active { transform: scale(0.99); }
.item:hover { border-color: var(--line); }
.item-title { font-weight: 650; font-size: 14.5px; }
.item-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.item + .item { margin-top: 10px; }
.item-chevron { color: var(--muted-2); flex: none; }
.item-chevron svg { width: 18px; height: 18px; }

/* Precio */
.price { font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.price-lg { font-size: 24px; }
.price-from { color: var(--muted-2); font-size: 12px; font-weight: 600; }

/* ------------------------------- Mapa ---------------------------------- */
.map {
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: #0b1220;
  border-radius: var(--r);
  overflow: hidden;
  z-index: 1;
}
.map-wrap {
  position: relative;
  height: 260px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1220;
}
.map-wrap.tall { height: 340px; }
.leaflet-container { background: #0b1220; font-family: inherit; }
.leaflet-control-attribution {
  background: rgba(6, 11, 20, 0.8) !important;
  color: var(--muted-2) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a {
  background: rgba(16, 24, 39, 0.94) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  backdrop-filter: blur(10px);
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: #131c2e;
  color: var(--text);
  box-shadow: var(--sh-lg);
  border-radius: var(--r);
}
.leaflet-popup-content { margin: 13px 15px; font-size: 13.5px; }
.leaflet-popup-close-button { color: var(--muted) !important; }

/* Marcadores */
.pin {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
  background: var(--grad-brand);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.8);
  border: 2.5px solid #fff;
}
.pin svg {
  width: 19px; height: 19px;
  color: #fff;
  transform: rotate(45deg);
}
.pin-cliente { background: var(--grad-mint); }
.pin-cliente svg { color: #04231a; }
.pin-me {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 3.5px solid #fff;
  background: var(--primary);
  transform: none;
  box-shadow: 0 0 0 7px rgba(79, 123, 255, 0.22);
}
.pin-me svg { display: none; }
.marker-bounce { animation: bounce 0.55s var(--ease); }
@keyframes bounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-11px); }
  100% { transform: translateY(0); }
}
.leaflet-marker-icon.pin-wrap { background: none; border: 0; }

/* Panel flotante sobre el mapa */
.map-overlay {
  position: absolute;
  left: 10px; right: 10px;
  z-index: 500;
  pointer-events: none;
}
.map-overlay > * { pointer-events: auto; }
.map-overlay-top { top: 10px; }
.map-overlay-bottom { bottom: 10px; }
.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: var(--pill);
  background: rgba(9, 14, 25, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: var(--sh);
}
.map-chip svg { width: 15px; height: 15px; }

/* ----------------------------- Tabbar app ------------------------------ */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 800;
  height: calc(var(--tabbar) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(8, 12, 21, 0.9);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-top: 1px solid var(--line-soft);
}
.tabbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 123, 255, 0.5), transparent);
}
.tab {
  position: relative;
  display: grid;
  place-items: center;
  gap: 3px;
  width: 62px;
  padding: 6px 0;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 650;
  transition: color var(--t);
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 23px; height: 23px; transition: transform var(--t); }
.tab.is-active { color: var(--primary); }
.tab.is-active svg { transform: translateY(-1px) scale(1.08); }
.tab.is-active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 22px; height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--grad-brand);
}
.tab-badge {
  position: absolute;
  top: 3px;
  right: 12px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--pill);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px #0a0f1c;
}
.tab-fab {
  width: 56px; height: 56px;
  border-radius: 19px;
  background: var(--grad-brand);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px -8px rgba(79, 123, 255, 0.85);
  margin-top: -22px;
  border: 3.5px solid #0a0f1c;
  transition: transform var(--t-fast);
}
.tab-fab:active { transform: scale(0.9); }
.tab-fab svg { width: 26px; height: 26px; }

/* ------------------------------ App shell ------------------------------ */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 18px calc(var(--tabbar) + var(--safe-b) + 26px);
  position: relative;
}
.app.has-map { padding-bottom: calc(var(--safe-b) + 26px); }

.appbar {
  position: sticky;
  top: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) 18px 12px;
  margin: 0 -18px 4px;
  background: linear-gradient(180deg, rgba(6, 9, 18, 0.95) 55%, rgba(6, 9, 18, 0));
  backdrop-filter: blur(10px);
}
.appbar-title { font-size: 19px; font-weight: 750; letter-spacing: -0.025em; }
.appbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

.view { animation: view-in 0.32s var(--ease); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Barra de conexion */
.conn-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--warn);
  background: rgba(255, 176, 32, 0.1);
  border-bottom: 1px solid rgba(255, 176, 32, 0.25);
}
/* El icono del SVG no trae tamano propio: sin esto se pinta gigante. */
.conn-bar svg {
  width: 14px;
  height: 14px;
  flex: none;
  animation: spin 1s linear infinite;
}
.conn-bar .sk-line { height: 10px; width: 160px; margin: 0; }

/* ------------------------- Tarjeta de servicio ------------------------- */
.req-card {
  position: relative;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--grad-surface);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: border-color var(--t);
}
.req-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--line);
  transition: background var(--t);
}
.req-card.s-buscando::before { background: var(--warn); }
.req-card.s-aceptada::before { background: var(--primary); }
.req-card.s-en_camino::before { background: var(--info); }
.req-card.s-en_servicio::before { background: var(--accent); }
.req-card.s-completada::before { background: #22c55e; }
.req-card.s-cancelada::before { background: var(--danger); }
.req-card.s-aceptada, .req-card.s-en_camino, .req-card.s-en_servicio {
  border-color: rgba(79, 123, 255, 0.3);
}
.req-card + .req-card { margin-top: 11px; }

.req-folio { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted-2); }

/* Timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -26px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 2.5px solid var(--line);
}
.tl-item.done::before { background: var(--accent); border-color: var(--accent); }
.tl-item.current::before {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 5px rgba(79, 123, 255, 0.18);
  animation: pulse-dot 1.6s infinite;
}
.tl-item.failed::before { background: var(--danger); border-color: var(--danger); }
.tl-title { font-weight: 650; font-size: 14.5px; }
.tl-time { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ETA grande */
.eta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(79, 123, 255, 0.16), rgba(123, 92, 255, 0.1));
  border: 1px solid rgba(79, 123, 255, 0.3);
}
.eta-num {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.eta-num small { font-size: 16px; font-weight: 700; -webkit-text-fill-color: var(--muted); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat {
  padding: 14px;
  border-radius: var(--r);
  background: var(--grad-surface);
  border: 1px solid var(--line-soft);
}
.stat-val {
  font-size: 24px;
  font-weight: 780;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-key {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
}

/* Barra de progreso */
.progress {
  height: 7px;
  border-radius: var(--pill);
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--pill);
  background: var(--grad-brand);
  width: 0;
  transition: width 0.6s var(--ease);
}
.progress-bar.mint { background: var(--grad-mint); }

/* ------------------------------ Sweets -------------------------------- */
.swal2-popup {
  background: #101827 !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-xl) !important;
  color: var(--text) !important;
  box-shadow: var(--sh-lg) !important;
  padding: 26px 22px !important;
  backdrop-filter: blur(20px);
}
.swal2-title { font-size: 20px !important; font-weight: 750 !important; color: var(--text) !important; }
.swal2-html-container { color: var(--muted) !important; font-size: 14.5px !important; }
.swal2-confirm, .swal2-cancel, .swal2-deny {
  border-radius: var(--r) !important;
  min-height: 48px !important;
  font-weight: 650 !important;
  font-size: 15px !important;
  box-shadow: none !important;
  flex: 1;
  margin: 0 !important;
}
.swal2-confirm { background: var(--grad-brand) !important; }
.swal2-cancel {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--muted) !important;
}
.swal2-icon { border: 0 !important; }
.swal2-icon.swal2-success [class^='swal2-success-line'] { stroke: var(--accent) !important; }
.swal2-icon.swal2-success .swal2-success-ring { stroke: rgba(0, 229, 160, 0.25) !important; }
.swal2-icon.swal2-error [class^='swal2-x-line'] { stroke: var(--danger) !important; }
.swal2-icon.swal2-error .swal2-x-mark { background: rgba(255, 92, 92, 0.18) !important; }
.swal2-icon.swal2-warning .swal2-warning-ring { stroke: var(--warn) !important; }
.swal2-toast {
  background: rgba(16, 24, 39, 0.96) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--sh-lg) !important;
  backdrop-filter: blur(16px);
}
.swal2-toast .swal2-title { font-size: 14.5px !important; }
.swal2-toast .swal2-icon { width: 20px !important; height: 20px !important; margin: 0 8px 0 0 !important; }
.swal2-toast .swal2-icon .swal2-icon-content { display: grid !important; place-items: center; }
.swal2-toast .swal2-icon .swal2-success-line, .swal2-toast .swal2-icon .swal2-error-x-line {
  stroke-width: 3;
}
.swal2-loading .swal2-styled.swal2-confirm { background: rgba(79,123,255,.5) !important; }

/* --------------------------- Sweet loading ----------------------------- */
/* Estilo "app estilo React": botones con spinner mientras espera */
.is-loading { position: relative; color: transparent !important; }
.is-loading > * { visibility: hidden; }
.is-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 19px; height: 19px;
  margin: -9.5px 0 0 -9.5px;
  border: 2.2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ------------------------- Animaciones varias -------------------------- */
.fade-up { animation: fade-up 0.44s var(--ease) both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.stagger > * { animation: fade-up 0.44s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.03s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.13s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.23s; }
.stagger > *:nth-child(6) { animation-delay: 0.28s; }

.pulse-once { animation: pulse-once 0.6s var(--ease); }
@keyframes pulse-once {
  50% { transform: scale(1.035); }
}

.shake { animation: shake 0.42s var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* ------------------------- Preferencia de motion ----------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------- Poscarga / PWA -------------------------- */
.install-bar {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tabbar) + var(--safe-b) + 12px);
  z-index: 850;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: rgba(16, 24, 39, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  animation: toast-in 0.4s var(--ease);
}
