* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #0d1b15;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.mobile-frame {
  width: 100%;
  max-width: 420px;
  height: 100vh;
  height: 100dvh;
  max-height: 860px;
  background-color: #f4f6f8;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  border-radius: 28px;
  overflow: hidden;
  border: 6px solid #222;
}

/* ENCABEZADO Y SWITCH EN LÍNEA / DESCONECTADO (ESTILO UBER RÁPIDO) */
.app-header {
  height: 65px;
  background-color: #1b4d3e;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
}

.brand-container { display: flex; align-items: center; gap: 10px; }
.logo-img { width: 34px; height: 34px; border-radius: 50%; background: white; object-fit: cover; }
.brand-container h1 { font-size: 1.1rem; font-weight: 700; line-height: 1.1; }
.sub-region { font-size: 0.7rem; color: #c8e6c9; }

.switch-estado {
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.switch-estado.online { background: #2e7d32; color: white; }
.switch-estado.online .dot { width: 9px; height: 9px; background: #69f0ae; border-radius: 50%; }

.switch-estado.offline { background: #757575; color: white; }
.switch-estado.offline .dot { width: 9px; height: 9px; background: #e0e0e0; border-radius: 50%; }

.banner-offline {
  position: absolute;
  top: 10px; left: 12px; right: 12px;
  background: #424242;
  color: white;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  text-align: center;
  z-index: 900;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.banner-offline.hidden { display: none; }

.tab-content { position: absolute; top: 65px; bottom: 68px; left: 0; right: 0; display: flex; flex-direction: column; }
.tab-content.hidden { display: none !important; }
#map { width: 100%; flex: 1; z-index: 1; }

.bottom-sheet {
  position: absolute; bottom: 10px; left: 12px; right: 12px;
  background: white; border-radius: 18px; padding: 14px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2); z-index: 800;
}
.sheet-drag-handle { width: 36px; height: 4px; background: #d0d0d0; border-radius: 2px; margin: 0 auto 10px auto; }
.section-title { font-size: 0.7rem; font-weight: 700; color: #757575; margin-bottom: 8px; }
.ciudadano-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar-circle { width: 40px; height: 40px; background: #e8f5e9; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ciudadano-info h3 { font-size: 0.95rem; color: #212121; }
.ciudadano-info p { font-size: 0.8rem; color: #616161; }
.materiales-box { background: #f4f6f8; padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; }
.materiales-label { font-size: 0.75rem; font-weight: 600; color: #424242; }
.materiales-val { font-size: 0.8rem; color: #2e7d32; font-weight: 600; }

/* BOTÓN ACEPTAR SOLICITUD ESTILO PÍLDORA VERDE */
.btn-principal-uber {
  width: 100%;
  background-color: #1b5e20;
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 28px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.3);
  transition: all 0.2s ease;
}

.btn-principal-uber:disabled {
  background-color: #a5d6a7;
  color: white;
  box-shadow: none;
  cursor: not-allowed;
}

.view-panel { background: #ffffff; flex: 1; padding: 16px; overflow-y: auto; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.stat-card { background: #f4f6f8; padding: 12px; border-radius: 12px; text-align: center; }
.stat-num { display: block; font-size: 1.3rem; font-weight: bold; color: #1b4d3e; }
.stat-label { font-size: 0.75rem; color: #666; }
.section-sub { font-size: 0.9rem; color: #333; margin: 12px 0 8px 0; }
.cards-list { display: flex; flex-direction: column; gap: 10px; }
.card-item { background: #fafafa; border: 1px solid #e0e0e0; border-radius: 10px; padding: 12px; }
.card-item.completado { border-left: 4px solid #2e7d32; }

.chat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.btn-completar-mini { background: #388e3c; color: white; border: none; padding: 6px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: bold; cursor: pointer; }
.chat-panel { display: flex; flex-direction: column; }
.chat-box-uber { flex: 1; min-height: 0; border: 1px solid #e0e0e0; border-radius: 12px; padding: 10px; overflow-y: auto; background: #fafafa; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { color: #9e9e9e; font-size: 0.8rem; text-align: center; margin-top: 30px; }
.chat-input-group { display: flex; gap: 8px; }
.chat-input-group input { flex: 1; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 0.85rem; }
.btn-enviar { background: #1b4d3e; color: white; border: none; padding: 0 14px; border-radius: 8px; font-weight: bold; }
.msg { padding: 8px 12px; border-radius: 10px; max-width: 85%; font-size: 0.8rem; }
.msg.sistema { background: #e3f2fd; color: #0d47a1; align-self: center; text-align: center; font-size: 0.7rem; }
.msg.reciclador { background: #e8f5e9; color: #1b5e20; align-self: flex-end; }
.msg.ciudadano { background: #ffffff; border: 1px solid #e0e0e0; align-self: flex-start; }

.profile-header { text-align: center; margin-bottom: 16px; }
.avatar-lg { font-size: 2.5rem; background: #e8f5e9; width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px auto; }
.badge-verificado { display: inline-block; background: #e8f5e9; color: #2e7d32; font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; font-weight: bold; }
.profile-details { margin-bottom: 24px; }
.detail-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.85rem; }
.detail-row span { color: #666; }

.btn-logout {
  width: 100%;
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
  padding: 14px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
}

/* BARRA DE NAVEGACIÓN INFERIOR ESTILO MATERIAL DESIGN */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #e8e8e8;
  z-index: 1000;
  padding-bottom: 6px;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #444444;
  cursor: pointer;
  padding-top: 4px;
}

.nav-icon-wrapper {
  position: relative;
  width: 60px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  transition: background-color 0.25s ease;
}

.nav-icon-svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #444444;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.25s ease, transform 0.25s ease;
}
.nav-icon-svg .acento { fill: transparent; transition: fill 0.25s ease; }
.nav-icon-svg .punto { fill: currentColor; stroke: none; }
.nav-icon-svg .hoja { fill: #66bb6a; stroke: #2e7d32; stroke-width: 1; }

.nav-item.active .nav-icon-wrapper {
  background-color: #c8e6c9;
}

.nav-item.active .nav-icon-svg {
  stroke: #1b5e20;
  transform: translateY(-1px) scale(1.08);
}
.nav-item.active .nav-icon-svg .acento { fill: #a5d6a7; }
.nav-item.active .nav-icon-svg .punto { fill: #1b5e20; }

.nav-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #555555;
  margin-top: 2px;
}

.nav-item.active .nav-label {
  color: #1b5e20;
  font-weight: 700;
}

/* ELEMENTOS NUEVOS: DETALLE DE LA SOLICITUD Y UTILIDADES */
.hidden { display: none !important; }

.bottom-sheet { max-height: 72%; overflow-y: auto; }
.materiales-extra { font-size: 0.75rem; color: #555; margin-top: 4px; }
.foto-solicitud { width: 100%; max-height: 110px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.btn-como-llegar {
  display: block;
  text-align: center;
  text-decoration: none;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px;
  border-radius: 22px;
  margin-bottom: 10px;
}

/* AVATAR 3D DEL RECICLADOR EN EL MAPA */
.avatar-reciclador { background: none; border: none; }
.avatar-3d {
  position: absolute; left: 0; top: 0; width: 56px; height: 74px;
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.35));
  animation: flotar 2.4s ease-in-out infinite;
}
.avatar-pulso {
  position: absolute; left: 50%; bottom: 0; width: 54px; height: 20px; margin-left: -27px;
  border-radius: 50%; background: rgba(46, 125, 50, 0.38);
  animation: pulso-gps 2s ease-out infinite;
}
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes pulso-gps { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.1); opacity: 0; } }

/* SERVICIO MÁS CERCANO Y BOTÓN ATRÁS */
.chip-cercano {
  position: absolute; top: 10px; left: 12px; z-index: 850; max-width: calc(100% - 90px);
  background: #ffffff; color: #1b5e20; border: none; border-radius: 20px;
  padding: 9px 14px; font-size: 0.78rem; font-weight: 700; text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); cursor: pointer;
}
.btn-atras {
  background: rgba(255, 255, 255, 0.16); color: #ffffff; border: none; border-radius: 50%;
  width: 34px; height: 34px; font-size: 1.15rem; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.aviso-app {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(12px);
  background: rgba(33, 33, 33, 0.92); color: #fff; padding: 10px 16px; border-radius: 20px;
  font-size: 0.78rem; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 3000; white-space: nowrap;
}
.aviso-app.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* PERFIL: AVATAR Y CARNET */
.bloque-perfil { margin-bottom: 16px; }
.selector-avatar { display: flex; gap: 8px; }
.opcion-avatar {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #f4f6f8; border: 2px solid transparent; border-radius: 12px; padding: 8px 4px;
  font-size: 0.72rem; font-weight: 600; color: #444; cursor: pointer;
}
.opcion-avatar.activa { border-color: #2e7d32; background: #e8f5e9; color: #1b5e20; }
.opcion-avatar-img { width: 44px; height: 58px; display: block; }
.carnet-card {
  background: #f4f6f8; border-radius: 16px; padding: 16px; margin-bottom: 18px; text-align: center;
}
.qr-carnet { display: flex; justify-content: center; margin: 8px 0; }
.qr-carnet img, .qr-carnet canvas { background: #fff; padding: 8px; border-radius: 10px; }
.carnet-codigo { font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; color: #1b4d3e; margin-bottom: 6px; }
.carnet-ayuda { font-size: 0.72rem; color: #666; line-height: 1.4; }

/* ============================================================
   CELULAR REAL / APK: sin marco simulado, pantalla completa
   (el marco redondeado con borde solo se ve en el computador)
   ============================================================ */
@media (max-width: 480px) {
  body { background-color: #f4f6f8; align-items: stretch; }
  .mobile-frame {
    max-width: none;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .app-header {
    height: calc(65px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  .tab-content {
    top: calc(65px + env(safe-area-inset-top, 0px));
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav {
    height: calc(68px + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .aviso-app { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}